473,387 Members | 3,801 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 2280
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: noah | last post by:
Does PHP have a feature to associate Cookie sessions with a persistent database connection that will allow a single transaction across multiple HTTP requests? Here is how I imagine my process: I...
1
by: F. GEIGER | last post by:
I've troubles to let my app take off using pysqlite. What I wonder most for now is that "pysqlite2.dbapi2.OperationalError: cannot commit transaction - SQL statements in progress" when I do this:...
4
by: Leaf | last post by:
Greetings, I've been reading with interest the threads here on deadlocking, as I'm finding my formerly happy app in a production environment suddenly deadlocking left and right. It started...
9
by: John Sidney-Woollett | last post by:
Is it possible to use the dblink and dblink_exec features from inside pl/pgsql functions to mimic the behaviour of nested transactions by calling another function or executing some SQL via the...
4
by: Mike Benoit | last post by:
I assume I'm not the first person to run in to this, however searching google didn't seem to come up with anything useful. its=> begin; delete from pay_stub_entry where pay_stub_id in (select id...
2
by: Phil Endecott | last post by:
Dear All, Within a transaction, now() and current_timestamp are constant and give the time that the transaction started. This is normally what you want. But I have a case where I actually need...
5
by: ashley.ward | last post by:
I am attempting to write a program with VB 2005 Express Edition which accesses an Oracle 9 database and dumps the results of three SELECT queries into a spreadsheet file once every hour. ...
0
by: Skywalker | last post by:
Hi. Can you please help me? I have problem;-) I am copying from one computer to another 50 MB large text file. For now is everything working. My question is, if I can in VBA for MS ACCESS show to...
0
by: Kurt | last post by:
Hello, I have questions about SQL Server and I hope you could help me a lot. - Is it possible to reduce the size of my transaction log file during the execution of a sql script ? Indeed, my sql...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.