force drop of database others are accessing

From: "Lee Harr" <missive(at)hotmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: force drop of database others are accessing
Date: 2004-01-24 00:18:06
Message-ID: BAY2-F165HYAXELZjDb0001a4f2@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Is there any way to forcibly disconnect all users from a
database, or else force the drop of the database even
though others are still connected?

I have a report I run where I first drop the old report db
then create it anew, read in a recent dump file and then
run a bunch of queries to build up the reports.

Every once in a while my automated script fails because
some other system which should have disconnected
failed to unhook. The old data and old connection are
not important to me. The new run needs to go through.

It seems like maybe using schema I could do this ... since
that does not remove the database, and I could drop ...
cascade to make sure everything goes, but all of my scripts
assume separate databases now, and they need to be
rethought and rewritten to work with schema.

Any ideas?

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Sullivan 2004-01-24 00:41:11 Re: force drop of database others are accessing
Previous Message Doug McNaught 2004-01-23 22:42:35 Re: Calling triggers with arguments