Thread: unlock / drop table

unlock / drop table

From
"Johnson, Shaunn"
Date:

Howdy:

Running PostgreSQL 7.2.1 on RedHat Linux 7.2 kernel 2.4.7-10.

I got a few people trying to drop tables; right now,
there is a lock on them and I want to kill that person's
lock and have the table dropped.

How can I:

a) find out who is locking the table (other than Postgres)

b) should I kill the pid of the LOCK so the table
   can continue it course or will that hurt something else
   (particularly the database)?

Thanks!

-X

Re: unlock / drop table

From
Andrew Sullivan
Date:
On Thu, Sep 26, 2002 at 12:41:15PM -0400, Johnson, Shaunn wrote:
> How can I:
>
> a) find out who is locking the table (other than Postgres)

You can find out the queris that are locking the table by using ps or
pg_monitor or something like that.  Once you have the pid, if you use
connection tracking in your logs, you can look in the logs for the
connection.

> b) should I kill the pid of the LOCK so the table
>    can continue it course or will that hurt something else
>    (particularly the database)?

kill -2 should be safe.

A

--
----
Andrew Sullivan                         204-4141 Yonge Street
Liberty RMS                           Toronto, Ontario Canada
<andrew@libertyrms.info>                              M2P 2A8
                                         +1 416 646 3304 x110


Re: unlock / drop table

From
Neil Conway
Date:
"Johnson, Shaunn" <SJohnson6@bcbsm.com> writes:
> a) find out who is locking the table (other than Postgres)

7.3 has a pg_locks system view that should be useful for this.

Cheers,

Neil

--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC