Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group