Re: transaction in progress - Mailing list pgsql-general

From Tom Lane
Subject Re: transaction in progress
Date
Msg-id 13605.1070725235@sss.pgh.pa.us
Whole thread Raw
In response to Re: transaction in progress  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-general
Bruce Momjian <pgman@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

pgsql-general by date:

Previous
From: Chris Travers
Date:
Subject: Feedback? Is there interest in a PostgreSQL-based CRM suite friendly to shared hosting?
Next
From: Cott Lang
Date:
Subject: Re: What is WAL used for?