Re: pg_locks: who is locking ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alexandre Arruda <alepaes(at)aldeiadigital(dot)com(dot)br>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_locks: who is locking ?
Date: 2006-10-16 23:51:17
Message-ID: 7733.1161042677@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alexandre Arruda <alepaes(at)aldeiadigital(dot)com(dot)br> writes:
> But pg_stat_activity joined with pg_locks only give me informations
> about the lock itself.
> Realy, I want a (possible) simple information: Who is locking me ?

You need a self-join to pg_locks to find the matching lock that is held
(not awaited) by some process, then join that to pg_stat_activity to
find out who that is.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andras Simon 2006-10-17 01:06:49 Permission problem with create tablespace
Previous Message Tom Lane 2006-10-16 23:47:35 Re: datatype preceded by underscore creates array