Re: relation column in pg_locks

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: fkurzawa(at)topazsoftware(dot)com
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: relation column in pg_locks
Date: 2004-08-26 16:01:02
Message-ID: 23223.1093536062@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Frank Kurzawa <fkurzawa(at)topazsoftware(dot)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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message A Gilmore 2004-08-26 17:11:41 Re: PGSQL and XML
Previous Message Frank Kurzawa 2004-08-26 15:53:07 relation column in pg_locks