Re: [GENERAL] Unable to connect to Postgresql

Поиск
Список
Период
Сортировка
От Daniel Verite
Тема Re: [GENERAL] Unable to connect to Postgresql
Дата
Msg-id 50e94bc7-7260-4fff-83dc-fb69f235db7a@manitou-mail.org
обсуждение исходный текст
Ответ на Re: [GENERAL] Unable to connect to Postgresql  (John Iliffe <john.iliffe@iliffe.ca>)
Список pgsql-general
    John Iliffe wrote:

> Yes, I will do that, but there are several hundred PHP web page scripts to
> be updated.  Presumably if one script opens two different databases then
> both of the pg_connect() instances will need to be updated.

If you have many calls to pg_connect() without a host
in the connect string, meaning it defaults to /tmp, instead of
changing them you may inject a PGHOST variable into the Apache
environment with /var/pgsql as the value. This will make it
the default host, so basically everything that was going
implicitly to /tmp will go to /var/pgsql instead.
I think in RedHat the definition should go into /etc/sysconfig/httpd

Generally the environment variables described for libpq here:
https://www.postgresql.org/docs/9.6/static/libpq-envars.html
apply to php's pg_connect() as well, since it's really just
a thin wrapper on top of libpq's PQconnectdb().

Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite


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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: [GENERAL] Unable to connect to Postgresql
Следующее
От: rob stone
Дата:
Сообщение: Re: [GENERAL] Unable to connect to Postgresql