Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id EF89B9FB25C for ; Thu, 5 Oct 2006 16:16:36 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 61695-10 for ; Thu, 5 Oct 2006 19:16:24 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by postgresql.org (Postfix) with ESMTP id 481679FB345 for ; Thu, 5 Oct 2006 16:16:24 -0300 (ADT) Received: from [194.25.154.138] (helo=webserv.wug.de) by mrelayeu.kundenserver.de (node=mrelayeu4) with ESMTP (Nemesis), id 0ML21M-1GVYhi1JZV-0002mL; Thu, 05 Oct 2006 21:16:22 +0200 Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) id 1GVYhh-000656-00 for pgsql-sql@postgresql.org; Thu, 05 Oct 2006 21:16:21 +0200 Date: Thu, 5 Oct 2006 21:16:21 +0200 From: "A. Kretschmer" To: pgsql-sql@postgresql.org Subject: Re: On Rollback my sequency does not back the initial value Message-ID: <20061005191621.GA23352@a-kretschmer.de> References: <55c095e90610051150x128edd9andf999a8ad873b28f@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55c095e90610051150x128edd9andf999a8ad873b28f@mail.gmail.com> User-Agent: Mutt/1.5.9i X-Provags-ID: kundenserver.de abuse@kundenserver.de login:51ea9561fc3f6d9539a2acd743e4748c X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200610/67 X-Sequence-Number: 26456 am Thu, dem 05.10.2006, um 15:50:58 -0300 mailte Ezequias Rodrigues da Rocha folgendes: > Hi, > > I am implementing a function that execute a rollback then some exception is > throwed. > > The problem is that my nextval('mysequency') does not return to the initial > value when the rollback is executed. Right, a sequence doesn't rollback. -- cite: Advance the sequence object to its next value and return that value. This is done atomically: even if multiple sessions execute nextval concurrently, each will safely receive a distinct sequence value. -- Source: http://www.postgresql.org/docs/8.1/interactive/functions-sequence.html HTH, Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47215, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net