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

Re: Cannot DROP while process running

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Steve Horn <steve(at)stevehorn(dot)cc>
Cc: Devrim GÜNDÜZ <devrim(at)gunduz(dot)org>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Cannot DROP while process running
Date: 2012-04-09 23:18:00
Message-ID: 15349.1334013480@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-novice
Steve Horn <steve(at)stevehorn(dot)cc> writes:
> 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.

Well, an AccessShareLock would definitely prevent you from dropping the
table.  The question is which session(s) are holding such locks and why.
I suspect that you have some long-running transactions, perhaps
accidentally so.  As Devrim mentioned, joining pg_locks against
pg_stat_activity would go a long way towards explaining what's blocking
your DROP attempt.

			regards, tom lane

In response to

Responses

pgsql-novice by date

Next:From: Steve HornDate: 2012-04-10 12:58:10
Subject: Re: Cannot DROP while process running
Previous:From: Steve HornDate: 2012-04-09 21:07:35
Subject: Re: Cannot DROP while process running

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