From: | Bill Moran <wmoran(at)potentialtech(dot)com> |
---|---|
To: | ljb <ljb1813(at)pobox(dot)com> |
Cc: | pgsql-php(at)postgresql(dot)org |
Subject: | Re: pg_transaction_status() unreliable?! |
Date: | 2009-05-05 14:57:47 |
Message-ID: | 20090505105747.a9e891bb.wmoran@potentialtech.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-php |
In response to ljb <ljb1813(at)pobox(dot)com>:
> wmoran(at)potentialtech(dot)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/
From | Date | Subject | |
---|---|---|---|
Next Message | Luis Esteban de Dios Núñez | 2009-05-09 16:56:00 | Me ha costado tanto... |
Previous Message | ljb | 2009-05-05 01:20:32 | Re: pg_transaction_status() unreliable?! |