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