Re: [PDO] PostgreSQL auto-reconnect in PDO contructor for permanent connections: request for comments
[email protected] (Joey Smith) Tue, 30 Mar 2010 14:42:33 -0600
| Newsgroups | php.pdo |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Mar 30, 2010 at 05:50:29PM +0200, Marc Barilley wrote: > This is something I'd like to add in the PostgreSQL driver. In order not > to break anything in the current implementation, my idea was to add a > driver specific constant (named PGSQL_ATTR_DEEP_CONNECTION_CHECK for > example, or anything that fits) that would make the driver run a "SELECT > 1" when retrieving a connection link from the pool to re-use it: if the > connection is actually broken, it would then be re-opened by the > subsequent code. The default would be keeping the way it works now. > Does this seem reasonnable? > > Thank you for your comments. I'm +1 on the idea, and suggest 'PDO::ATTR_PGSQL_PING' as the constant name.