Skip site navigation (1) Skip section navigation (2)

PostgreSQL and PHP persistent connections

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "Thies C(dot) Arntzen" <thies(at)digicol(dot)de>
Cc: Rasmus(at)candle(dot)pha(dot)pa(dot)us, Lerdorf <rasmus(at)php(dot)net>, PostgreSQL-interfaces <pgsql-interfaces(at)postgresql(dot)org>
Subject: PostgreSQL and PHP persistent connections
Date: 2001-02-07 19:12:26
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfacespgsql-jdbc
Thies, we talked at LinuxWorld about improving the reliability of
persistent PostgreSQL connections in PHP.

I believe the problem is that persistent connections sometime do not
pass clean sessions because of open transactions and SET changes to the

We discussed using 'ROLLBACK' before passing a connection to a new user,
but the problem was that ROLLBACK with no open transaction causes a
server log error message.  We discussed adding 'ROLLBACK SILENT' to fix
this, but I believe a better, more portable solution is a simple "BEGIN
WORK;ROLLBACK".  This will do nothing if there is no open transaction,
and will ROLLBACK any open transaction.  I propose this be sent by PHP
as the first query when passing persistent connections.

As far as SET changes, does anyone on the PostgreSQL interfaces list
have a suggestion on how to RESET all session parameters?  Seems we may
need to add this feature in to the backend.

  Bruce Momjian                        |
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026


pgsql-interfaces by date

Next:From: Peter EisentrautDate: 2001-02-07 19:20:16
Subject: Re: pgAccess fails to launch on HPUX
Previous:From: Ross J. ReedstromDate: 2001-02-07 18:49:13
Subject: Re: [INTERFACES] pgAccess fails to launch on HPUX

pgsql-jdbc by date

Next:From: Thies C. ArntzenDate: 2001-02-07 19:56:12
Subject: Re: PostgreSQL and PHP persistent connections
Previous:From: Dror MatalonDate: 2001-02-07 17:32:13
Subject: Re: Re: [INTERFACES] Q on JDBC's resultset

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group