Thread: Deduce table name from OID?

Deduce table name from OID?

From
Zak McGregor
Date:
Hi all

Does anyone know if it is possible to work out from an OID alone which
table it references?

Thanks

Cheers

Zak

--
Zak McGregor    http://www.carfolio.com - Over 7000 car specs online
Web mercenary - currently for hire. Perl/html/.js/sql/cgi/GNUlinux/php +
Prevent links wrapping in emails: http://www.carfolio.com/redirect/add
---------------------------------------------------------------------
Money capers:       http://www.theregister.co.uk/content/7/14017.html


Re: Deduce table name from OID?

From
Richard Huxton
Date:
Zak McGregor wrote:
>
> Does anyone know if it is possible to work out from an OID alone which
> table it references?

richardh=> select oid,relname from pg_class where oid=1044019;
   oid   | relname
---------+---------
 1044019 | foo

HTH

- Richard Huxton