How to detect if in transaction? - Mailing list pgsql-novice

From Basil Bourque
Subject How to detect if in transaction?
Date
Msg-id 040F4D17-CCFC-49A8-96BF-524ECD3BF97C@me.com
Whole thread Raw
Responses Re: How to detect if in transaction?  (John DeSoi <desoi@pgedit.com>)
List pgsql-novice
How can I tell if a session is in a pending transaction? In other words, a "BEGIN TRANSACTION" has been issued but the
transactionhas not yet done a COMMIT or ROLLBACK. How can I ask if that is the condition? 

I've googled and searched the archives. Others have asked the question, but I've not seen an answer. I did read that
Postgresdefaults to AUTO-COMMIT until I issue a "BEGIN TRANSACTION". I want to programmatically detect that condition
forthe sake of defensive programming, logging, debugging, and so on. 

--Basil Bourque



pgsql-novice by date:

Previous
From: Mark Smith
Date:
Subject: ECPG date output depends on database datestyle
Next
From: John DeSoi
Date:
Subject: Re: How to detect if in transaction?