BUG #4023: The transaction control does not work for sequences

Started by Giovani Murilo Dantas Correaabout 18 years ago2 messagesbugs
Jump to latest
#1Giovani Murilo Dantas Correa
contato@isolution.inf.br

The following bug has been logged online:

Bug reference: 4023
Logged by: Giovani Murilo Dantas Correa
Email address: contato@isolution.inf.br
PostgreSQL version: 8.3.0 and 8.1.9
Operating system: Linux 2.6.X (Slackware and Fedora)
Description: The transaction control does not work for sequences
Details:

create sequence seq_test;
select nextval('seq_test'); --return value 1
select nextval('seq_test'); --return value 2
select nextval('seq_test'); --return value 3
BEGIN;
select nextval('seq_test'); --return value 4
select nextval('seq_test'); --return value 5
select nextval('seq_test'); --return value 6
ROLLBACK;
select currval('seq_test'); --return value 6

This is not right. The currval must have be 3 and not 6.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Giovani Murilo Dantas Correa (#1)
Re: BUG #4023: The transaction control does not work for sequences

"Giovani Murilo Dantas Correa" <contato@isolution.inf.br> writes:

Description: The transaction control does not work for sequences

This is not a bug. It is an intentional and very clearly documented
behavior.

regards, tom lane