X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id BE8E25347C for ; Tue, 29 Mar 2005 08:05:09 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 32035-02 for ; Tue, 29 Mar 2005 07:05:01 +0000 (GMT) Received: from houston.familyhealth.com.au (houston.au.fhnetwork.com [203.22.197.21]) by svr1.postgresql.org (Postfix) with ESMTP id 9168852A65 for ; Tue, 29 Mar 2005 08:04:57 +0100 (BST) Received: from houston.familyhealth.com.au (localhost [127.0.0.1]) by houston.familyhealth.com.au (Postfix) with ESMTP id CA2D824FE1; Tue, 29 Mar 2005 15:04:51 +0800 (WST) Received: from [192.168.0.40] (work-40.internal [192.168.0.40]) by houston.familyhealth.com.au (Postfix) with ESMTP id C2E7E24FCE; Tue, 29 Mar 2005 15:04:51 +0800 (WST) Message-ID: <4248FE1D.8070304@familyhealth.com.au> Date: Tue, 29 Mar 2005 15:05:01 +0800 From: Christopher Kings-Lynne User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Yulius Tjahjadi Cc: pgsql-php@postgresql.org Subject: Re: question about postgres persistent connection in php References: <08F5636B48FE8F4D856E209D0E6C0637A83E57@hq01.ultimatearena.com> In-Reply-To: <08F5636B48FE8F4D856E209D0E6C0637A83E57@hq01.ultimatearena.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.069 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200503/65 X-Sequence-Number: 3080 > 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