Re: How to drop all the sequences

From: "Berend Tober" <btober(at)seaworthysys(dot)com>
To: <neilc(at)samurai(dot)com>
Cc: <arun_jaisankar(at)yahoo(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to drop all the sequences
Date: 2003-02-21 13:23:42
Message-ID: 64529.216.238.112.88.1045833822.squirrel@$HOSTNAME
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Thu, 2003-02-20 at 11:40, Arunachalam Jaisankar wrote:
>
>> 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.
>

This is what I do:

Save the output of

SELECT 'drop sequence ' || c.relname || ';' FROM pg_class c WHERE
(c.relkind = 'S');

to a file and then run that.

~Berend Tober

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Patrick Welche 2003-02-21 13:38:24 Re: jdbc in OO
Previous Message Andrew Sullivan 2003-02-21 13:23:31 Re: Authentication to run pg_dump automatically