Re: php with postgres - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: php with postgres
Date
Msg-id 200307242157.h6OLvdK04384@candle.pha.pa.us
Whole thread Raw
In response to Re: php with postgres  (Jan Wieck <JanWieck@Yahoo.com>)
Responses Re: php with postgres  (marcus.boerger@t-online.de (Marcus Börger))
List pgsql-hackers
Jan Wieck wrote:
> Marcus B?rger wrote:
> > ATM i have a patch doing the following:
> > Connect:
> >  If PQprotocolVersion() is available and >= 3 PQparameterStatus() is available
> >  then i check the server version. Else i check the lib version (*).
> >  If the version to check is >= 7.2 ido one of the following:
> >  - If one of PQprotocolVersion() and PQtransactionStatus() is unavailable or
> >    protocol version < 3:
> >      "BEGIN;COMMIT;RESET ALL;"
> > 
> >  - If protocol version >= 3 and transaction status == PQTRANS_IDLE:
> >      "RESET ALL;"
> >  - If protocol version >= 3 and transaction status != PQTRANS_IDLE:
> >      "COMMIT;RESET ALL;"
> 
> Shouldn't that be
> 
>      ROLLBACK; RESET ALL;
> 
> and the other one "BEGIN; ROLLBACK; RESET ALL;" ?
> 
> I don't want to have the possibly partial transaction from a crashed PHP 
> script to be committed by default. At least it would be a significant 
> difference between persistent and non-persistent connections, because we 
> rollback if we loose the connection.

Right, as I just emailed.  I wonder if we made the mistake of
recommending BEGIN;COMMIT; to the PHP folks a while back, or whether they
just did it themselves.

I remember telling them they couldn't just do ROLLBACK because that
would fill the logs, but I am not sure how they got BEGIN;COMMIT;
rather than BEGIN;ROLLBACK.  It just shows we need better communication
between the communities.

--  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: Sailesh Krishnamurthy
Date:
Subject: Re: this is in plain text (row level locks)