pg_locks relation cant be found in pg_class

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey,
I'm trying to map an oid of relations in pg_lock to a relation name with the following query : 
select locktype,relname,database,mode,pid,granted from pg_locks,pg_class where locktype='relation' and pg_locks.relation=pg_class.oid;

However, I'm getting only relations of system catalogs and not other relations.. pg_locks contains rows for many relations, for example : 
postgres=# select relation,count(*) from pg_locks where locktype='relation' group by relation order by count desc;
 relation | count
----------+-------
    16531 |     4
   320587 |     3
    16535 |     3
   320585 |     3

but in the result of my first query I dont get the relation name. For example : 
postgres=# select count(*) from pg_class where oid in (16531,320587,16535);
 count
-------
     0

any idea ?

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux