Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id DB3752E009B for ; Thu, 20 Mar 2008 11:30:23 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 70732-01 for ; Thu, 20 Mar 2008 11:30:07 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by postgresql.org (Postfix) with SMTP id 674AB2E0097 for ; Thu, 20 Mar 2008 11:30:07 -0300 (ADT) Received: (qmail 8559 invoked by uid 0); 20 Mar 2008 14:30:05 -0000 Received: from 62.218.164.126 by www138.gmx.net with HTTP; Thu, 20 Mar 2008 15:30:04 +0100 (CET) Cc: pgsql-sql@postgresql.org Content-Type: text/plain; charset="us-ascii" Date: Thu, 20 Mar 2008 15:30:05 +0100 From: "Jan Peters" In-Reply-To: <47E26D3B.4010102@postnewspapers.com.au> Message-ID: <20080320143005.95720@gmx.net> MIME-Version: 1.0 References: <20080320134208.42400@gmx.net> <47E26D3B.4010102@postnewspapers.com.au> Subject: Re: Rollback locks table - why? To: Craig Ringer X-Authenticated: #16900582 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) X-Priority: 3 X-Provags-ID: V01U2FsdGVkX186sz1ZuyI630LoaEczxfmzL8tw63jqBg7jLzC2Gb ccuay1D8Eh2rYqH3LPEu5uEiXlH2uD2Yt6EA== Content-Transfer-Encoding: 7bit X-GMX-UID: iAWLKBYdMydherG0a2tllFFjaGRhZpoZ X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200803/149 X-Sequence-Number: 30477 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 (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 Jan -- GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen! Jetzt dabei sein: http://www.shortview.de/?mc=sv_ext_mf@gmx