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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-bugs by date

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