Re: [SQL] begin/end/abort work for sequences?

From: José Soares <jose(at)sferacarta(dot)com>
To: Kyle <kyle(at)actarg(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] begin/end/abort work for sequences?
Date: 1999-06-30 12:08:53
Message-ID: 377A08D5.77180127@sferacarta.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Kyle ha scritto:

> I assumed that wrapping a call to nextval() in a transaction would allow
> me to roll back the update of the sequence. But when I do the following:
>
> begin;
> select nextval('po_seq');
> abort;
>
> The sequence po_seq is advancing to the next value even though the
> transaction was aborted. If I put other things like updates, inserts, etc.
> inside the transaction, they seem to be rolled back OK, but not the
> update of the sequence.
>
> Am I doing something wrong?

No. I can't explain you why but AFAIK sequences don't rollback.
______________________________________________________________
PostgreSQL 6.5.0 on i586-pc-linux-gnu, compiled by gcc 2.7.2.3
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jose'

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Darren Greer 1999-06-30 12:27:02 More fun with random selects
Previous Message Petter Reinholdtsen 1999-06-30 08:53:03 Oracle greatest() and nvl() equivalent?