Re: pg_locks: who is locking ? - Mailing list pgsql-general

From Tom Lane
Subject Re: pg_locks: who is locking ?
Date
Msg-id 7733.1161042677@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_locks: who is locking ?  (Alexandre Arruda <alepaes@aldeiadigital.com.br>)
Responses Re: pg_locks: who is locking ? (SOLVED!)
List pgsql-general
Alexandre Arruda <alepaes@aldeiadigital.com.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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: datatype preceded by underscore creates array
Next
From: "Andras Simon"
Date:
Subject: Permission problem with create tablespace