Re: in failed sql transaction - Mailing list pgsql-general

From Scott Marlowe
Subject Re: in failed sql transaction
Date
Msg-id 1159194986.4033.2.camel@localhost.localdomain
Whole thread Raw
In response to in failed sql transaction  (Ralf Wiebicke <ralf.wiebicke@exedio.com>)
List pgsql-general
On Sun, 2006-09-24 at 12:03 +0200, Ralf Wiebicke wrote:
> Hi all!
>
> 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.
> All other databases I used up to now just ignore the statement violating the
> constraint, but leave the transaction intact.
>
> Is this intended behaviour or rather a bug? Or is there any way to "switch on"
> the behaviour I'd like to see?

Normal behaviour.

Have you read up on savepoints?

http://www.postgresql.org/docs/8.1/interactive/sql-savepoint.html

It allows you to set a point to rollback to should an error occur.

pgsql-general by date:

Previous
From: Bill Moran
Date:
Subject: Re: copy db1 to db2
Next
From: "Brandon Aiken"
Date:
Subject: Re: serial column