Re: How to drop all the sequences

From: Neil Conway <neilc(at)samurai(dot)com>
To: Arunachalam Jaisankar <arun_jaisankar(at)yahoo(dot)com>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to drop all the sequences
Date: 2003-02-21 06:42:53
Message-ID: 1045809773.583.438.camel@tokyo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 2003-02-20 at 11:40, Arunachalam Jaisankar wrote:
> I found sequences are not getting dropped when tables are dropped.

SERIAL sequences should automatically be dropped with their
corresponding table in PostgreSQL 7.3.0 and later.

> It is too difficult to drop all sequences one by one manually. Is
> there any command to drop all sequences in a database?

No. You could try iterating through pg_class, picking out the sequence
relations (relkind = 'S') in the right database, and then dropping the
sequences that way.

Cheers,

Neil
--
Neil Conway <neilc(at)samurai(dot)com> || PGP Key ID: DB3C29FC

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Neil Conway 2003-02-21 06:52:40 Re: Authentication to run pg_dump automatically
Previous Message Neil Conway 2003-02-21 06:40:43 Re: reindex vs. drop index , create index