BUG #1127: ALTER SEQUENCE bug - Mailing list pgsql-bugs

From PostgreSQL Bugs List
Subject BUG #1127: ALTER SEQUENCE bug
Date
Msg-id 20040406123519.73176CF53A5@www.postgresql.com
Whole thread Raw
Responses Re: BUG #1127: ALTER SEQUENCE bug  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged online:

Bug reference:      1127
Logged by:          Piotr Konieczny

Email address:      znahor@vix.netsync.pl

PostgreSQL version: 7.4

Operating system:   Linux

Description:        ALTER SEQUENCE bug

Details:

ALTER SEQUENCE doesn't work properly, when only first value has been readed
from sequence:

test=# create TABLE t (s serial, t text);
NOTICE:  CREATE TABLE will create implicit sequence "t_s_seq" for "serial"
column "t.s"
NOTICE:  CREATE TABLE will create implicit sequence "t_s_seq" for "serial"
column "t.s"
CREATE TABLE
test=# insert into t (t) VALUES ('1');
INSERT 17151 1
test=# select * from t;
 s | t
---+---
 1 | 1
(1 row)

test=# delete from t;
DELETE 1

test=# ALTER sequence t_s_seq restart 1;
ALTER SEQUENCE
test=# insert into t (t) VALUES ('1');
INSERT 17152 1
test=# select * from t;
 s | t
---+---
 2 | 1
(1 row)

test=# delete from t;
DELETE 1
test=# ALTER sequence t_s_seq restart 1;
ALTER SEQUENCE
test=# insert into t (t) VALUES ('1');
INSERT 17153 1
test=# select * from t;
 s | t
---+---
 1 | 1
(1 row)

test=#

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: bug in 7.4.2, with Handling of Double Quotation Marks
Next
From: "PostgreSQL Bugs List"
Date:
Subject: BUG #1128: horology tests fails while make check (7.4.2)