Re: [GENERAL] Unable to connect to Postgresql

Поиск
Список
Период
Сортировка
От John Iliffe
Тема Re: [GENERAL] Unable to connect to Postgresql
Дата
Msg-id 201704101127.48137.john.iliffe@iliffe.ca
обсуждение исходный текст
Ответ на Re: [GENERAL] Unable to connect to Postgresql  ("Daniel Verite" <daniel@manitou-mail.org>)
Ответы Re: [GENERAL] Unable to connect to Postgresql  ("Daniel Verite" <daniel@manitou-mail.org>)
Список pgsql-general
On Monday 10 April 2017 09:46:54 Daniel Verite wrote:
>     John Iliffe wrote:
> > Based on the reference that Joe sent earlier, I do have a second
> > domain socket on /var/pgsql but the problem is how do I get PHP to
> > look there?
>
>   pg_connect("host=/var/pgsql [...other parameters...]")
>
> The fact that the value for host starts with a slash indicates
> without ambiguity that it's a path on disk rather than the name
> or address of a host on the network.
>
YUP IT WORKS!

to borrow Apache's happy-message when you first install it.

So, the problem is resolved, although I have no idea why it was necessary.
Also, I now have several hundred programmes to update to add the host path
and none of them will now be portable.

Somehow this seems a step backwards, but my sincere thanks to everyone on
this list who helped me.  The whole thing was way beyond my detailed
understanding of Linux.

I provided some further information in a previous memo about the details of
the unit file which may provide some information for those who understand
such things.  It might be a good idea to provide some details of the
systemctl process in the Postgresql documentation for people who are first
encountering it (like me) when they have been used to the old init.d file
approach.

I will bring the same thing to Apache's attention on their list too.

Regards,

John

> However if apache runs in a chroot jail, it should no more see
> /var/pgsql than it sees /tmp
> Given an apache process id, on Linux you should be able
> to check the current filesystem-root of that process with
> # ls -ld /proc/$PID/root
> It should show a soft link to the directory that corresponds to
> the root from the point of view of the $PID process.
>
> But again, most people would use host=localhost in this setup.
>
> Best regards,


В списке pgsql-general по дате отправления:

Предыдущее
От: John Iliffe
Дата:
Сообщение: Re: [GENERAL] Unable to connect to Postgresql
Следующее
От: "Daniel Verite"
Дата:
Сообщение: Re: [GENERAL] Unable to connect to Postgresql