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

Re: [GENERAL] Use of Serial Datatype and Sequence Issue

From: Jean-Michel POURE <jm(dot)poure(at)freesurf(dot)fr>
To: pgsql-general(at)postgresql(dot)org
Cc: pgadmin-hackers(at)postgresql(dot)org
Subject: Re: [GENERAL] Use of Serial Datatype and Sequence Issue
Date: 2001-11-06 07:58:40
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgadmin-hackerspgsql-general
At 00:28 02/11/01 +0000, you wrote:
>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.

pgAdmin2 knows how to drop indexes when dropping a table:
It might not be interesting to drop a sequence as it can be used by 
multiple tables.

Dave: do you think pgAdmin2 should drop a sequence when dropping a table?

Best regards,
Jean-Michel POURE

In response to

pgadmin-hackers by date

Next:From: Dave PageDate: 2001-11-06 08:17:05
Subject: Re: [GENERAL] Use of Serial Datatype and Sequen
Previous:From: Keary SuskaDate: 2001-11-06 06:42:51
Subject: Re: Use of Serial Datatype and Sequence Issue

pgsql-general by date

Next:From: Jean-Michel POUREDate: 2001-11-06 08:02:06
Subject: Re: functions, shell script
Previous:From: Jean-Michel POUREDate: 2001-11-06 07:52:35
Subject: Re: Referring a table in another database

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