Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 3B877632D10 for ; Tue, 5 May 2009 11:57:55 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 48934-09 for ; Tue, 5 May 2009 11:57:52 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.potentialtech.com (internet.potentialtech.com [66.167.251.6]) by mail.postgresql.org (Postfix) with ESMTP id 6C3AF632A26 for ; Tue, 5 May 2009 11:57:52 -0300 (ADT) Received: from vanquish.ws.pitbpa0.priv.collaborativefusion.com (pr40.pitbpa0.pub.collaborativefusion.com [206.210.89.202]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.potentialtech.com (Postfix) with ESMTPSA id 805FBEBC0A; Tue, 5 May 2009 10:57:48 -0400 (EDT) Date: Tue, 5 May 2009 10:57:47 -0400 From: Bill Moran To: ljb Cc: pgsql-php@postgresql.org Subject: Re: pg_transaction_status() unreliable?! Message-Id: <20090505105747.a9e891bb.wmoran@potentialtech.com> In-Reply-To: References: <20090501170302.2eb5eb84.wmoran@potentialtech.com> <20090504153421.2e940587.wmoran@potentialtech.com> <20090504194806.GC13811@it.is.rice.edu> <20090504165704.b8a0027d.wmoran@potentialtech.com> X-Mailer: Sylpheed 2.6.0 (GTK+ 2.14.7; i386-portbld-freebsd7.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.333 tagged_above=0 required=5 tests=PLING_QUERY=1.333 X-Spam-Level: * X-Archive-Number: 200905/6 X-Sequence-Number: 4026 In response to ljb : > 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. So you're saying that pg_get_result() returns the "result" of the query, even though the query isn't complete yet. Then I have to call it again to update the client-side information on the status of the connection. As I said, if it's what needs to be done, then fine. But it still doesn't seem logical to me. -- Bill Moran http://www.potentialtech.com http://people.collaborativefusion.com/~wmoran/