Re: relation column in pg_locks - Mailing list pgsql-novice

From Tom Lane
Subject Re: relation column in pg_locks
Date
Msg-id 23223.1093536062@sss.pgh.pa.us
Whole thread Raw
In response to relation column in pg_locks  (Frank Kurzawa <fkurzawa@topazsoftware.com>)
List pgsql-novice
Frank Kurzawa <fkurzawa@topazsoftware.com> writes:
> How can I find out what object corresponds to a given OID in the
> relation column in the pg_locks table?

Join to pg_class.oid:

select relname from pg_locks, pg_class where relation = pg_class.oid;

or cast it to regclass:

select relation::regclass from pg_locks;

            regards, tom lane

pgsql-novice by date:

Previous
From: Frank Kurzawa
Date:
Subject: relation column in pg_locks
Next
From: A Gilmore
Date:
Subject: Re: PGSQL and XML