Skip site navigation (1) Skip section navigation (2)

Re: Rollback locks table - why?

From: "Jan Peters" <petersjan(at)gmx(dot)at>
To: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Rollback locks table - why?
Date: 2008-03-20 14:30:05
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
Hello Craig,

> Jan Peters wrote:
> > If I run the transaction block from above again I get first a unique key
> violation (that is ok, because that's what I trying to check for) but
> there is NO rollback to sp1, only the "Unique Key" error message and after that
> I get the dreaded "current transaction is aborted" error message and the
> system reports an EXCLUSIVE LOCK on the table (<IDLE>in transaction).
> >   
> Am I correct in saying that your issue is really that you want an error
> to trigger an automatic rollback to the last savepoint, but it does not
> do so ?
> If you issue the ROLLBACK manually (after you get the constraint error
> or a "current transaction is aborted" message) does it work as you would
> expect?

Yes, you are correct: I just want to issue an insertion of a row at the very beginning of an application start. So, when the table "test" is empty,  the row with "runde = 0"  should be inserted. If this row is already present, it should be updated.

How do I do a "manual" ROLLBACK?

Regards and thank you again in advance

GMX startet Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein:

In response to

pgsql-sql by date

Next:From: Gurjeet SinghDate: 2008-03-20 14:30:38
Subject: Re: Select into
Previous:From: Craig RingerDate: 2008-03-20 13:57:15
Subject: Re: Rollback locks table - why?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group