Re: Ye olde drop-the-database-you-just-left problem - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Ye olde drop-the-database-you-just-left problem
Date
Msg-id 5837.1180546543@sss.pgh.pa.us
Whole thread Raw
In response to Re: Ye olde drop-the-database-you-just-left problem  (Magnus Hagander <magnus@hagander.net>)
List pgsql-hackers
Magnus Hagander <magnus@hagander.net> writes:
> Tom Lane wrote:
>> AFAICT a "real" fix for this would involve making PQfinish() synchronous
>> (don't return till backend is dead), which doesn't seem like a great
>> idea.  However, it suddenly struck me that we could probably make most
>> of the problem go away if we put that same wait into DROP DATABASE
>> itself --- that is, if we see other backends in the target DB, sleep
>> for a second or two and then recheck before erroring out.

> An option could be to add a PQfinishWait() API call, and have psql use
> this one when passed a special commandline argument (which if I
> understood right this guys "commerercial alternative" had). It might be
> useful in other cases as well, but I can't really think of one right now :-)

The trouble with trying to fix this on the client side is that it's not
fixed unless every client behaves that way (all the time).  Otherwise
we'll still be hearing the same complaints.  "Use this magic little
option on the previous connection" isn't a user-friendly answer.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Style of file error messages
Next
From: Brian Hurt
Date:
Subject: Re: Ye olde drop-the-database-you-just-left problem