Re: COMMIT after an ERROR?

From: Charles Tassell <ctassell(at)isn(dot)net>
To: J C Lawrence <claw(at)kanga(dot)nu>, pgsql-general(at)postgresql(dot)org
Subject: Re: COMMIT after an ERROR?
Date: 2001-10-12 19:10:49
Message-ID: 4.3.2.7.2.20011012160913.00c2be20@mailer.isn.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

The failed query will abort the transaction, and throw out every command
that comes before or after it until your rollback. You don't have to
specifically issue a rollback unless you want to issue more commands
though. When you disconnect from the DB it will automatically roll back
the transaction.

At 05:18 AM 10/12/01, J C Lawrence wrote:

>Does an error during a transaction invalidate the transaction?
>
>eg
>
> BEGIN
> SomeQueryThatSucceeds
> SomeQueryThatFails
> SomeOtherQueryThatSucceeds
> COMMIT
>
>Will the transaction successfully COMMIT, or will the COMMIT fail?
>
>Translation: Do I need to monitor for error conditions during a
>transaction and manually do the ROLLBACK in those cases?
>
>--
>J C Lawrence
>---------(*) Satan, oscillate my metallic sonatas.
>claw(at)kanga(dot)nu He lived as a devil, eh?
>http://www.kanga.nu/~claw/ Evil is a name of a foeman, as I live.
>
>---------------------------(end of broadcast)---------------------------
>TIP 4: Don't 'kill -9' the postmaster

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Gould 2001-10-12 19:22:49 Re: PG mailing list problems (was Re: Support issues)
Previous Message Stephan Szabo 2001-10-12 19:09:02 Re: Vacuum analyze with 7 millions records ... takes 1