Re: How to detect if in transaction?
| От | John DeSoi |
|---|---|
| Тема | Re: How to detect if in transaction? |
| Дата | |
| Msg-id | F6B81278-30E9-479E-8861-45D10B222645@pgedit.com обсуждение исходный текст |
| Ответ на | How to detect if in transaction? (Basil Bourque <basil.list@me.com>) |
| Ответы |
Re: How to detect if in transaction?
|
| Список | pgsql-novice |
On Jan 18, 2011, at 3:52 PM, Basil Bourque wrote: > How can I tell if a session is in a pending transaction? In other words, a "BEGIN TRANSACTION" has been issued but thetransaction has 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. What client interface are you using to connect to Postgres? This information is available using the low level communicationprotocol, but I'm not sure there is an SQL command to give the status. John DeSoi, Ph.D.
В списке pgsql-novice по дате отправления: