Re: Drop database / database in use question - Mailing list pgsql-general

From Scott Marlowe
Subject Re: Drop database / database in use question
Date
Msg-id dcc563d10810170730t54cbae2ej45b10a21e9e683a2@mail.gmail.com
Whole thread Raw
In response to Re: Drop database / database in use question  ("Dan Armbrust" <daniel.armbrust.list@gmail.com>)
List pgsql-general
On Fri, Oct 17, 2008 at 8:28 AM, Dan Armbrust
<daniel.armbrust.list@gmail.com> wrote:
> But there is no user2.  I _know_ I am the only user of this database.
>
> So how can User 1 create a race condition by himself?
>
> Or is this something PostgreSQL is doing internally (like vacuum) ?
>
> Do I really just have to keep trying the DROP command N times in a
> row, until it decides it wants to work?  That really doesn't seem
> right.

Could be autovac.  Easiest way is to use psql -c to get a list of pids
that are connected and kill the backends (just kill, not kill -9) then
try to drop it again.  loop through that every few seconds and it
should work.

pgsql-general by date:

Previous
From: Luca Ferrari
Date:
Subject: Re: OR or IN ?
Next
From: "Scott Marlowe"
Date:
Subject: Re: OR or IN ?