Re: php with postgres - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: php with postgres
Date
Msg-id 200307220120.h6M1KRL08372@candle.pha.pa.us
Whole thread Raw
In response to Re: php with postgres  (Jan Wieck <JanWieck@Yahoo.com>)
Responses Re: php with postgres  ("scott.marlowe" <scott.marlowe@ihs.com>)
Re: php with postgres  (marcus.boerger@t-online.de (Marcus Börger))
List pgsql-hackers
Jan Wieck wrote:
> Bruce Momjian wrote:
> > Marcus B?rger wrote:
> >> BM> Marcus, would you check if PHP is using RESET ALL when passing
> >> BM> persistent connection to new clients?  We added that capability a few
> >> BM> releases ago, specifically for PHP persistent connections, but I don't
> >> BM> think that ever got into the PHP code.
> >> 
> >> Unfortunately we don't do so yet. Do i need to check for errors or can i do it
> >> unconditionally on conenction start? And i'd need to know how to check if it
> >> is available (like starting with which version).
> > 
> > It first appeared in PostgreSQL version 7.2.  It doesn't generate any
> > failures.  It just resets all SET settting to their defaults, in case
> > the previous client modified them.
> > 
> 
> It does generate the usual error if the current transaction block is in 
> ABORT state. So the correct querystring to send would be something like
> 
>      "ROLLBACK; RESET ALL"

Oh, I remember that now as part of the persistent connection code.  As I
remember, we told them to do BEGIN;COMMIT; to clear any open transaction
state passed to the new client.  Is that in there?  If not, it has to be
added too.  ROLLBACK will generate an error if you are not in a
transaction, so it would fill the logs with errors.

--  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: Jan Wieck
Date:
Subject: Re: php with postgres
Next
From: Bruce Momjian
Date:
Subject: Re: [pgsql-advocacy] [GENERAL] Postgresql & AMD x86-64