pg.ddx.io pgsql-interfaces@postgresql.org mailing list archivehelp / color / mirror / Atom feed
aborted transactions 2+ messages / 2 participants [nested] [flat]
* aborted transactions @ 1998-10-25 12:34 Peter Garner <peter.garner@toward.com> 0 siblings, 1 reply; 2+ messages in thread From: Peter Garner @ 1998-10-25 12:34 UTC (permalink / raw) To: pgsql-interfaces; +Cc: peter.garner@toward.com Hi All! :-) I am using the libpq C interface to access postgres from C++. I am VERY impressed with postgres!!! Although postgres does not seem to support nested transactions, it does support serialized, non nested transactions. However, it seems to me that if certain queries fail, the current transaction is aborted and all queries are ignored until the transaction is ended, either via commit or rollback. At least that is what seems to be happening. The following message is printed after every query (after a failing query) until the transaction is over, and it does seem that queries are ignored until the end of transaction : NOTICE: (transaction aborted): queries ignored until END So is there anyway to alter this behaviour or should I code like this will always happen. Also if there is no begin transaction block, I assume that each statement is a unit of work and that all subsequent queries will work. I.e. it would be absurd if one failed query caused all subsequent queries to be ignored until the connection closed. Is this correct? Thank you Peter ^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [INTERFACES] aborted transactions @ 1998-10-26 01:22 Tom Lane <tgl@sss.pgh.pa.us> parent: Peter Garner <peter.garner@toward.com> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 1998-10-26 01:22 UTC (permalink / raw) To: peter.garner@toward.com; +Cc: pgsql-interfaces "Peter Garner" <peter.garner@toward.com> writes: > However, it seems to me that if certain > queries fail, the current transaction is aborted and all > queries are ignored until the transaction is ended, either > via commit or rollback. *Any* backend-detected "fatal" error causes the transaction to be aborted. I've kinda wished that transactions (atomic update) could be separated from error-abort also, but right now the two always go together in Postgres. > Also if there is no begin > transaction block, I assume that each statement is a unit > of work and that all subsequent queries will work. Right: a statement appearing outside any begin-transaction block is treated as a self-contained transaction. regards, tom lane ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~1998-10-26 01:22 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 1998-10-25 12:34 aborted transactions Peter Garner <peter.garner@toward.com> 1998-10-26 01:22 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox