Antw: Rollback & Nextval fails

Поиск
Список
Период
Сортировка
От Gerhard Dieringer
Тема Antw: Rollback & Nextval fails
Дата
Msg-id s9325817.046@kopo001
обсуждение исходный текст
Список 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




В списке pgsql-sql по дате отправления:

Предыдущее
От: "Eriksson, Fredrik"
Дата:
Сообщение: Rollback & Nextval fails
Следующее
От: Grant Finnemore
Дата:
Сообщение: Re: Rollback & Nextval fails