From: Christopher Kings-Lynne <chriskl@familyhealth.com.au>
To: Yulius Tjahjadi <yulius@xfire.com>
Cc: pgsql-php@postgresql.org
Subject: Re: question about postgres persistent connection in php
Date: Tue, 29 Mar 2005 15:05:01 +0800
Message-ID: <4248FE1D.8070304@familyhealth.com.au> (raw)
In-Reply-To: <08F5636B48FE8F4D856E209D0E6C0637A83E57@hq01.ultimatearena.com>
References: <08F5636B48FE8F4D856E209D0E6C0637A83E57@hq01.ultimatearena.com>
> A majority of our sql statements in the logs are BEGIN; ROLLBACK;
> that is created by the php persistent connection and I want to
> see if I can get rid of them.
Try changing these lines:
orig = PGG(ignore_notices);
PGG(ignore_notices) = 1;
res = PQexec(link,"BEGIN;");
PQclear(res);
res = PQexec(link,"ROLLBACK;");
PQclear(res);
PGG(ignore_notices) = orig;
to this:
if ((PQprotocolVersion(link) >= 3 && PQtransactionStatus(link)
!= PQTRANS_IDLE) || PQprotocolVersion(link) < 3)
{
orig = PGG(ignore_notices);
PGG(ignore_notices) = 1;
res = PQexec(link,"ROLLBACK;");
PQclear(res);
PGG(ignore_notices) = orig;
}
And recompile.
Chris
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-php@postgresql.org
Cc: chriskl@familyhealth.com.au, yulius@xfire.com
Subject: Re: question about postgres persistent connection in php
In-Reply-To: <4248FE1D.8070304@familyhealth.com.au>
References: <08F5636B48FE8F4D856E209D0E6C0637A83E57@hq01.ultimatearena.com> <4248FE1D.8070304@familyhealth.com.au>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox