Re: DROP DATABASE always seeing database in use - Mailing list pgsql-hackers

From Tom Lane
Subject Re: DROP DATABASE always seeing database in use
Date
Msg-id 5684.1217866191@sss.pgh.pa.us
Whole thread Raw
In response to Re: DROP DATABASE always seeing database in use  ("Heikki Linnakangas" <heikki@enterprisedb.com>)
Responses Re: DROP DATABASE always seeing database in use  (Jens-Wolfhard Schicke <drahflow@gmx.de>)
List pgsql-hackers
"Heikki Linnakangas" <heikki@enterprisedb.com> writes:
> Tom Lane wrote:
>> I've been bit by that too, and so have other people.  Maybe it'd be
>> worth the trouble to improve the message so that it explicitly tells you
>> when there are prepared transactions blocking the DROP.

> Yes, that should be easy enough.

I looked at this quickly and decided that we can do it with some small
changes to CheckOtherDBBackends().  I propose counting the number of
conflicting PGPROCs and adding a DETAIL line to the existing error
message:

ERROR: database "%s" is being accessed by other users
DETAIL: There are %d session(s) and %d prepared transaction(s) using the database.

I'm aware that this phrasing might not translate very nicely ... anyone
have a suggestion for better wording?
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Heikki Linnakangas"
Date:
Subject: Re: DROP DATABASE always seeing database in use
Next
From: "David Blewett"
Date:
Subject: PL/PythonU