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

From Andrew Sullivan
Subject Re: force drop of database others are accessing
Date
Msg-id 20040124004111.GA13227@phlogiston.dyndns.org
Whole thread Raw
In response to force drop of database others are accessing  ("Lee Harr" <missive@hotmail.com>)
List pgsql-general
On Sat, Jan 24, 2004 at 12:18:06AM +0000, Lee Harr wrote:
> 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.

You can look for people connected and kick them out with kill -2 on
their pid.  The trick is to start your own script (which probably
isn't "failing" exactly, but blocking, right?), and then (since
you've locked the relevant objects that way, such that nobody else
can get in) use the shell to kill -2 other connections.  Evil and
possibly dangerous, but you said you didn't care about the old data.

A

--
Andrew Sullivan  | ajs@crankycanuck.ca
I remember when computers were frustrating because they *did* exactly what
you told them to.  That actually seems sort of quaint now.
        --J.D. Baldwin

pgsql-general by date:

Previous
From: "Lee Harr"
Date:
Subject: force drop of database others are accessing
Next
From: Eric B.Ridge
Date:
Subject: Re: Touch row ?