Skip site navigation (1) Skip section navigation (2)

BUG #1127: ALTER SEQUENCE bug

From: "PostgreSQL Bugs List" <pgsql-bugs(at)postgresql(dot)org>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1127: ALTER SEQUENCE bug
Date: 2004-04-06 12:35:19
Message-ID: 20040406123519.73176CF53A5@www.postgresql.com (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      1127
Logged by:          Piotr Konieczny

Email address:      znahor(at)vix(dot)netsync(dot)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=#




Responses

pgsql-bugs by date

Next:From: PostgreSQL Bugs ListDate: 2004-04-06 13:09:02
Subject: BUG #1128: horology tests fails while make check (7.4.2)
Previous:From: Tom LaneDate: 2004-04-06 05:07:25
Subject: Re: bug in 7.4.2, with Handling of Double Quotation Marks

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group