Re: [GENERAL] Unable to connect to Postgresql - Mailing list pgsql-general

From rob stone
Subject Re: [GENERAL] Unable to connect to Postgresql
Date
Msg-id 1491865606.6586.1.camel@gmail.com
Whole thread Raw
In response to Re: [GENERAL] Unable to connect to Postgresql  (John Iliffe <john.iliffe@iliffe.ca>)
List pgsql-general
Hello John,

On Mon, 2017-04-10 at 16:23 -0400, John Iliffe wrote:
> On Monday 10 April 2017 11:53:35 Daniel Verite wrote:
> >       John Iliffe wrote:
> > > So, the problem is resolved, although I have no idea why it was
> > > necessary.
> > 
>

Good to hear.

> > 
>
> 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.
>

Are you saying that every single PHP script has its own separate
routine to connect to the database?

We have just a single class to do connection stuff and the parameters
are held in pg_service.conf. That file has to be readable by Apache.
You just pass in an argument that represents the database to which you
want to connect, and it grabs host, port, etc. out of the service file.
All you have to do is keep the service file up-to-date.

Cheers,
Rob


pgsql-general by date:

Previous
From: "Daniel Verite"
Date:
Subject: Re: [GENERAL] Unable to connect to Postgresql
Next
From: John Iliffe
Date:
Subject: Re: [GENERAL] Unable to connect to Postgresql