Re: in failed sql transaction

From: "Gurjeet Singh" <singh(dot)gurjeet(at)gmail(dot)com>
To: "Michael Fuhr" <mike(at)fuhr(dot)org>
Cc: "Ralf Wiebicke" <ralf(dot)wiebicke(at)exedio(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: in failed sql transaction
Date: 2006-09-25 09:46:07
Message-ID: 65937bea0609250246p109ce574j79d0c883b54a170f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I too have been bothered about this behaviour in the past.

On 9/25/06, Michael Fuhr <mike(at)fuhr(dot)org> wrote:
>
> Transactions are all-or-nothing: all statements must succeed or the

Correct.

> All other databases I used up to now just ignore the statement violating
> the
> > constraint, but leave the transaction intact.
>
> Which databases behave that way? Does COMMIT succeed even if some
> statements failed?

Oracle, for one, behaves that way... Yes, COMMIT does succeed even if some
statement(s) threw errors.

This is intended behavior. You can use savepoints to roll back
> part of a transaction so the transaction can continue after an
> error.

Probably, the 'other' DBs have implemented that by an implicit savepoint
just before a command, and rollong back to it automatically, if the
transaction fails.

This is quite a desirable feature...

--
gurjeet(at)EnterpriseDB(dot)com
singh(dot)gurjeet(at){ gmail | hotmail | yahoo }.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bo Lorentsen 2006-09-25 10:01:36 Re: Replication and PITR
Previous Message Ronin 2006-09-25 09:15:58 hi, what is wrong with my newbie sql?