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

From Gregory Stark
Subject DROP DATABASE always seeing database in use
Date
Msg-id 87vdyh59zc.fsf@oxford.xeocode.com
Whole thread Raw
Responses Re: DROP DATABASE always seeing database in use  (Alvaro Herrera <alvherre@commandprompt.com>)
Re: DROP DATABASE always seeing database in use  (Michael Fuhr <mike@fuhr.org>)
Re: DROP DATABASE always seeing database in use  (Russell Smith <mr-russ@pws.com.au>)
List pgsql-hackers
It seems there's something wrong with CheckOtherDBBackends() but I haven't
exactly figured out what. There are no other sessions but drop database keeps
saying "regression" is being accessed by other users. I do see Autovacuum
touching tables in regression but CheckOtherDBBackends() is supposed to send
it a sigkill if it finds it and it doesn't seem to be doing so.

I've been hacking on unrelated stuff in this database and have caused multiple
core dumps and autovacuum is finding orphaned temp tables. It's possible some
state is corrupted in some way here but I don't see what.


postgres=# select * from pg_stat_activity; datid | datname  | procpid | usesysid | usename |          current_query
    | waiting |          xact_start           |          query_start          |         backend_start         |
client_addr| client_port 
 

-------+----------+---------+----------+---------+---------------------------------+---------+-------------------------------+-------------------------------+-------------------------------+-------------+-------------11505
|postgres |    5616 |       10 | stark   | select * from pg_stat_activity; | f       | 2008-08-04 11:46:05.438479+01 |
2008-08-0411:46:05.438956+01 | 2008-08-04 11:45:19.827702+01 |             |          -1
 
(1 row)

postgres=# commit;
COMMIT

postgres=# drop database regression;
ERROR:  55006: database "regression" is being accessed by other users
LOCATION:  dropdb, dbcommands.c:678


select * from pg_stat_activity; 
postgres=#  datid | datname  | procpid | usesysid | usename |          current_query          | waiting |
xact_start          |          query_start          |         backend_start         | client_addr | client_port 
 

-------+----------+---------+----------+---------+---------------------------------+---------+-------------------------------+-------------------------------+-------------------------------+-------------+-------------11505
|postgres |    5616 |       10 | stark   | select * from pg_stat_activity; | f       | 2008-08-04 11:46:45.619642+01 |
2008-08-0411:46:45.620115+01 | 2008-08-04 11:45:19.827702+01 |             |          -1
 
(1 row)


--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Ask me about EnterpriseDB's On-Demand Production
Tuning


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Location for pgstat.stat
Next
From: Alvaro Herrera
Date:
Subject: Re: DROP DATABASE always seeing database in use