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

Re: Cannot DROP while process running

From: Steve Horn <steve(at)stevehorn(dot)cc>
To: Devrim GÜNDÜZ <devrim(at)gunduz(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Cannot DROP while process running
Date: 2012-04-09 21:07:35
Message-ID: CAFLkBaUbJb=-BJ2Sw9h2A_nJTirXe9Bmz9ku3RHVbtshH6+Wsg@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
I ran this command:
select pg_class.relname,pg_locks.* from pg_class,pg_locks where
pg_class.relfilenode=pg_locks.relation;

and it appears that almost every table in my database has
""AccessShareLock". I have read that those locks are placed on tables for
SELECT access.

There should be no queries actively accessing the other tables in that
database (this database is in development only). A second question would
be, can I clear those locks?

2012/4/9 Devrim GÜNDÜZ <devrim(at)gunduz(dot)org>

> On Mon, 2012-04-09 at 16:08 -0400, Tom Lane wrote:
> > > When I issue the drop command for a table, the server doesn't
> > respond - not
> > > even with increased disk activity or CPU usage. I am wondering if a
> > lock is
> > > blocking it?
> >
> > Look into pg_locks to find out.
>
> We probably need a better view which joins pg_stat_activity and
> pg_locks, along with the new pg_stat_activity column in 9.2, which will
> give users better idea about what is locking what...
> --
> Devrim GÜNDÜZ
> Principal Systems Engineer @ EnterpriseDB: http://www.enterprisedb.com
> PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
> Community: devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
> http://www.gunduz.org  Twitter: http://twitter.com/devrimgunduz
>



-- 
Steve Horn

In response to

Responses

pgsql-novice by date

Next:From: Tom LaneDate: 2012-04-09 23:18:00
Subject: Re: Cannot DROP while process running
Previous:From: Devrim GÜNDÜZDate: 2012-04-09 20:12:47
Subject: Re: Cannot DROP while process running

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