Re: Use of Serial Datatype and Sequence Issue

From: Doug McNaught <doug(at)wireboard(dot)com>
To: Tom Innes <tinnes(at)inforamp(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Use of Serial Datatype and Sequence Issue
Date: 2001-11-05 17:57:09
Message-ID: m3hes9rthm.fsf@belphigor.mcnaught.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers pgsql-general

Tom Innes <tinnes(at)inforamp(dot)net> writes:

> I am new to postgres and am in the process of creating a new database of
> several 100 tables. Most of the tables have a serial datatype. When the
> table is created psql says it is creating an implicit sequence. Yet
> when I drop the table and even when I drop the database the sequence is
> still there. When I try to re-create the table it fails beacuse the
> sequence already exists. This same behaviour exists for indexes. How
> can I get rid of any sequences or indexes that have been created. I
> would prefer not to explicitly drop each one. Ideally I would like to
> drop the table and have all related indexes, sequences dropped.

Hmmm, I see part of this bug in 7.1.2 as well. The index goes away
when the table is dropped, but the sequence remains and causes an
error when I try to recreate the table. But dropping the database
(with DROP DATABASE or with 'destroydb' from the shell) blows away
everything, including the sequence, as it should.

Haven't got 7.1.3 to try it on--what version are you using?

-Doug
--
Let us cross over the river, and rest under the shade of the trees.
--T. J. Jackson, 1863

In response to

Browse pgadmin-hackers by date

  From Date Subject
Next Message Keary Suska 2001-11-05 20:03:54 Re: Use of Serial Datatype and Sequence Issue
Previous Message Dave Page 2001-11-03 21:50:44 Re: New Graphics

Browse pgsql-general by date

  From Date Subject
Next Message qradius 2001-11-05 18:02:05 about quotes on stored procedures
Previous Message Tom Lane 2001-11-05 17:57:04 Re: EXCEPT performace