Thread: who has lock on table/row

who has lock on table/row

From
"Mir S Islam"
Date:
Is there a way to find out who(if any) has lock on a table ? Basically I am
trying to do an insert update transaction and it is waiting and waitin until
I hit cancel. Since the application heavily uses transactions/commits I am
assuming somewhere it is leaving something open because of which the
following queries are not updating.

Thanks
Mir



Re: who has lock on table/row

From
Tom Lane
Date:
"Mir S Islam" <mislam@mindspring.com> writes:
> Is there a way to find out who(if any) has lock on a table ?

Not at the moment.  We need a utility to dump out the contents of the
lock manager's data structures, but no one's got round to it.

> Basically I am
> trying to do an insert update transaction and it is waiting and waitin until
> I hit cancel. Since the application heavily uses transactions/commits I am
> assuming somewhere it is leaving something open because of which the
> following queries are not updating.

Try using "ps" to look for a backend that is sitting in "idle in
transaction" state.
        regards, tom lane