On Sun, Sep 24, 2006 at 12:03:59PM +0200, Ralf Wiebicke wrote:
> I just realized the following behaviour in postgresql: when I violate any
> constraint (unique constraint in my case) then the transaction is not usable
> anymore. Any other sql command returns a "in failed sql transaction" error.
Transactions are all-or-nothing: all statements must succeed or the
transaction fails (but see below regarding savepoints).
> 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?
> Is this intended behaviour or rather a bug? Or is there any way to "switch on"
> the behaviour I'd like to see?
This is intended behavior. You can use savepoints to roll back
part of a transaction so the transaction can continue after an
error.
--
Michael Fuhr