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

sequence havn't been dropped.

From: Bhuvan A <bhuvansql(at)yahoo(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: sequence havn't been dropped.
Date: 2002-03-14 05:11:21
Message-ID: Pine.LNX.4.20.0203141034230.31828-100000@Larry (view raw or flat)
Thread:
Lists: pgsql-bugs
hi,

Hope you might have came accross this problem earlier. it exists in
7.1.x and 7.2 as well.

while creating a table with a column of type 'serial', well a sequence
has been created and the default value of that field is set to nextval
of that sequence, fine. But while dropping that table, why aren't that
sequence dropped?

example:

bhuvandb=# CREATE TABLE seq_test (id serial, name text);
NOTICE:  CREATE TABLE will create implicit sequence 'seq_test_id_seq'
for SERIAL column 'seq_test.id'
NOTICE:  CREATE TABLE/UNIQUE will create implicit index
'seq_test_id_key' for table 'seq_test'
CREATE

bhuvandb=# DROP TABLE seq_test ;
DROP

bhuvandb=# CREATE TABLE seq_test (id serial, name text);
NOTICE:  CREATE TABLE will create implicit sequence 'seq_test_id_seq'
for SERIAL column 'seq_test.id'
NOTICE:  CREATE TABLE/UNIQUE will create implicit index
'seq_test_id_key' for table 'seq_test'

ERROR:  Relation 'seq_test_id_seq' already exists

hope, developers would have their own reasons. but wish to know
that. thats it.

Regards,
Bhuvaneswaran.



Responses

pgsql-bugs by date

Next:From: Peter EisentrautDate: 2002-03-14 05:53:20
Subject: Re: sequence havn't been dropped.
Previous:From: Peter EisentrautDate: 2002-03-13 23:06:16
Subject: Re: Case sensitive table names ?

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