Incorrect "ERROR: database "xxx" is being accessed by other users" - Mailing list pgsql-general

From Dmitry Koterov
Subject Incorrect "ERROR: database "xxx" is being accessed by other users"
Date
Msg-id d7df81620703130037w731d1bbaycb83894a65d0478e@mail.gmail.com
Whole thread Raw
Responses Re: Incorrect "ERROR: database "xxx" is being accessed by other users"  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Hello.

I have a database which I cannot delete (the same for rename):

#  psql -d template1
=# drop database xxx;
ERROR:  database "xxx" is being accessed by other users

But it is NOT accessed by anybody, because:
1. ps ax|grep post shows that there is NO active connections to database xxx;
2. I restarter postmaster and immediately try to delete the database - the same error message
3. I stopped web-server, and now it is GUARANTEED that there is no connections :-)

What other diagnostics could I do?

P. S.
This database has other stranges, like:
1. VALUUM FULL VERBOSE ANALYZE hands at the middle of this database and never stops its execution;
2. there are some problems when I create a foreign key to particular table: it also hangs (postmaster restart does not correct this)
3. database is 2-3 times slow than it could be (if I restore it from the backup to the new place, it works 2-3 times faster)

Practically I have already dump+restore this database to a new location (xxx_new) and work with it only, but I want to remove the old (broken?) database xxx and I cannot...

pgsql-general by date:

Previous
From: Guido Neitzer
Date:
Subject: Re: Multi DB performance test
Next
From: Tom Lane
Date:
Subject: Re: Incorrect "ERROR: database "xxx" is being accessed by other users"