Skip site navigation (1) Skip section navigation (2)

Re: Ye olde drop-the-database-you-just-left problem

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Ye olde drop-the-database-you-just-left problem
Date: 2007-05-30 17:35:43
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Magnus Hagander <magnus(at)hagander(dot)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

In response to

pgsql-hackers by date

Next:From: Brian HurtDate: 2007-05-30 17:36:14
Subject: Re: Ye olde drop-the-database-you-just-left problem
Previous:From: Tom LaneDate: 2007-05-30 17:21:25
Subject: Re: Style of file error messages

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group