469,106 Members | 2,314 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,106 developers. It's quick & easy.

transaction in progress

Is there a convenient way to tell in postgres if a transaction has been
started or not?
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 12 '05 #1
2 2118
Rick Gigger wrote:
Is there a convenient way to tell in postgres if a transaction has been
started or not?


libpq has PQtransactionStatus, though I wonder why we don't have this
visible via a read-only GUC variable to make it easier for other languages.

Anyone?

--
Bruce Momjian | http://candle.pha.pa.us
pg***@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 12 '05 #2
Bruce Momjian <pg***@candle.pha.pa.us> writes:
libpq has PQtransactionStatus, though I wonder why we don't have this
visible via a read-only GUC variable to make it easier for other languages.


Because it'd be useless --- the only way to interrogate it would be via
SHOW or some other SQL command, which would have the effect of changing
your transaction status, at least with client libraries that implement
autocommit. Not to mention that the SHOW itself would fail if you're
in a failed transaction.

You have to have an out-of-band mechanism for checking xact status.
Thus PQtransactionStatus. AFAIK there are already equivalent APIs
in other popular libraries.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by John Sidney-Woollett | last post: by
2 posts views Thread by Phil Endecott | last post: by
5 posts views Thread by ashley.ward | last post: by
reply views Thread by Kurt | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by kglaser89 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.