force drop of database others are accessing - Mailing list pgsql-general

From Lee Harr
Subject force drop of database others are accessing
Date
Msg-id BAY2-F165HYAXELZjDb0001a4f2@hotmail.com
Whole thread Raw
Responses Re: force drop of database others are accessing  (Andrew Sullivan <ajs@crankycanuck.ca>)
List 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


pgsql-general by date:

Previous
From: Doug McNaught
Date:
Subject: Re: Calling triggers with arguments
Next
From: Andrew Sullivan
Date:
Subject: Re: force drop of database others are accessing