Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id A90D563329E for ; Mon, 4 May 2009 22:27:21 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 89072-08 for ; Mon, 4 May 2009 22:27:11 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by mail.postgresql.org (Postfix) with ESMTP id 211C0632996 for ; Mon, 4 May 2009 22:27:20 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.14.3/8.14.3) with ESMTP id n451RDun061826 for ; Mon, 4 May 2009 22:27:13 -0300 (ADT) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.3/8.14.3/Submit) id n451KWS7059335 for pgsql-php@postgresql.org; Mon, 4 May 2009 22:20:32 -0300 (ADT) (envelope-from news) From: ljb X-Newsgroups: pgsql.interfaces.php Subject: Re: pg_transaction_status() unreliable?! Date: Tue, 5 May 2009 01:20:32 +0000 (UTC) Organization: Hub.Org Networking Services Lines: 19 Message-ID: References: <20090501170302.2eb5eb84.wmoran@potentialtech.com> <20090504153421.2e940587.wmoran@potentialtech.com> <20090504194806.GC13811@it.is.rice.edu> <20090504165704.b8a0027d.wmoran@potentialtech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@news.hub.org User-Agent: slrn/0.9.9p1 (Linux) To: pgsql-php@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1 tagged_above=0 required=5 tests=AWL=-0.333, PLING_QUERY=1.333 X-Spam-Level: * X-Archive-Number: 200905/5 X-Sequence-Number: 4025 wmoran@potentialtech.com wrote: >... > > Not that it says anything about PQtransactionStatus being affected by > the use of it. If I read this literally, PQgetResult could return a > result set that is incomplete, which begs the question: how do I merge > the remaining part of the result set when I get it back next time? > > Of course, that's not the intended usage, which leads me to wonder > what's going on when I know factually that I have no more query > results pending, yet I have to call it again (apparently) to update > the client's internal status data structures. Actually pg_transaction_status doesn't talk to the server at all. The information it needs is available at the client side. What is happening is that you are calling pg_transaction_status before you and the server have finished discussing the COMMIT (meaning, you haven't called pg_get_result enough to finish the protocol). So the client side hasn't been told that the transaction is over.