Re: php with postgres - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: php with postgres
Date
Msg-id 200307230419.h6N4Jjr26539@candle.pha.pa.us
Whole thread Raw
In response to Re: php with postgres  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
List pgsql-hackers
Christopher Kings-Lynne wrote:
> > > DEBUG:  InitPostgres
> > > DEBUG:  StartTransactionCommand
> > > DEBUG:  query: select getdatabaseencoding()
> > > DEBUG:  ProcessQuery
> > > DEBUG:  CommitTransactionCommand
> > > DEBUG:  StartTransactionCommand
> > > DEBUG:  query: RESET ALL
> > > DEBUG:  ProcessUtility: RESET ALL
> > > DEBUG:  CommitTransactionCommand
> > > DEBUG:  StartTransactionCommand
> > > DEBUG:  query: BEGIN;ROLLBACK;
> > > DEBUG:  ProcessUtility: BEGIN;ROLLBACK;
> > > DEBUG:  CommitTransactionCommand
> > > DEBUG:  StartTransactionCommand
> > > DEBUG:  ProcessUtility: BEGIN;ROLLBACK;
> > > DEBUG:  CommitTransactionCommand
> > > DEBUG:  pq_recvbuf: unexpected EOF on client connection
> > >
> >
> > And this is the wrong order of things. The BEGIN;ROLLBACK; has to be
> > done first, otherwise if the connection was left in an aborted open
> > transaction by the previous script, the other two actions will fail.
> 
> Surely PHP can be modified so as to use the new 3.0 protocol feature to
> detect whether it's in a transaction or not, so as to avoid unnecssary
> querying?

Yes, you could, but it hardly seems worth it because they have to
support old and new protocols.  Eventually, yes, they could use that to
eliminate the BEGIN;COMMIT.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_conn not declared in libpq-fe.h?
Next
From: Bruce Momjian
Date:
Subject: Re: php with postgres