Antw: Rollback & Nextval fails

Gerhard Dieringer <dieringg@eba-haus.de>

From: "Gerhard Dieringer" <DieringG@eba-haus.de>
To: <pgsql-sql@hub.org>, <Fredrik_Eriksson@NAI.com>
Date: 2000-05-29T09:44:21Z
Lists: pgsql-sql
Fredrik Eriksson wrote:

> I have been trying the following SQL code :

> BEGIN;
> INSERT INTO table VALUES ( NEXTVAL('serial'), 'Data' );
> ROLLBACK;

> And the insert function is rolled back but the serial sequence isn't. Hav I
> misunderstood the functionality of rollback or is this a bug? Is there
> someway to get the functionality that rollsback everything?

It's not a bug but a feature. 
Sequence numbers exist to create unique entity-id-number with (usually) no external meaning, so 
1.) there is no need to roll them back
2.) the system would have to keep a list, what sequence number were rolled back.

Gerhard