Re: Problem Dropping a Database with users connected to it

From: Eric Dorland <eric(dot)dorland(at)mcgill(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Problem Dropping a Database with users connected to it
Date: 2005-01-14 20:59:18
Message-ID: 1105736359.7029.28.camel@garuda.wcg.mcgill.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 2005-01-14 at 10:58 -0600, Bruno Wolff III wrote:
> On Fri, Jan 14, 2005 at 11:16:16 -0500,
> Eric Dorland <eric(dot)dorland(at)mcgill(dot)ca> wrote:
> >
> > * Disconnecting all other users before dropping the db, but that doesn't
> > seem possible (I could start and stop the db, but that doesn't stop any
> > clients from just reconnecting right away).
>
> You could use an alter pg_hba.conf file while doing the drop.
>
> > * Just drop all the tables, etc. instead of dropping the db. There
> > doesn't seem to be a good way to do this except doing an explicit DROP
> > TABLE foo on all 200 tables. Is there a good recipe for this, an easy
> > way to get a listing of all the tables in a db?
>
> If all of the tables are in the public schema, dropping that schema should
> cascade to dropping all of the tables.

I had not considered dropping the schema, but that sounds like a good
solution. I'll give it a shot.

--
Eric Dorland
eric(dot)dorland(at)mcgill(dot)ca
WCG
514.398-5023 ext. 09562

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2005-01-14 20:59:28 Re: postmaster listening on specified addresses
Previous Message Doug McNaught 2005-01-14 20:52:13 Re: postmaster listening on specified addresses