Re: Finding description pg_description - Mailing list pgsql-general

From Tom Lane
Subject Re: Finding description pg_description
Date
Msg-id 2945430.1598474458@sss.pgh.pa.us
Whole thread Raw
In response to Finding description pg_description  (Susan Hurst <susan.hurst@brookhurstdata.com>)
List pgsql-general
Susan Hurst <susan.hurst@brookhurstdata.com> writes:
> How do I find the source of an objoid from pg_catalog.pg_description?

The classoid column holds the OID of the system catalog that contains
the object's defining row.  The objoid column is the OID of the object,
ie the "oid" column of that row.  (If you are working with a pre-v12
PG release you might be confused by the fact that the oid column is
hidden by default.  But it's there and you can select it.)

Depending on what you're doing, you might prefer to use the
pg_describe_object() function to decipher those columns:

regression=# select classoid::regclass, pg_describe_object(classoid, objoid, objsubid), description from pg_description
limit5; 
 classoid |        pg_describe_object         |                     description
----------+-----------------------------------+------------------------------------------------------
 pg_proc  | function ts_debug(regconfig,text) | debug function for text search configuration
 pg_proc  | function ts_debug(text)           | debug function for current text search configuration
 pg_proc  | function boolin(cstring)          | I/O
 pg_proc  | function boolout(boolean)         | I/O
 pg_proc  | function byteain(cstring)         | I/O
(5 rows)

Alternately, locutions like "where classoid = 'pg_proc'::regclass"
might be helpful.

            regards, tom lane



pgsql-general by date:

Previous
From: George Woodring
Date:
Subject: Re: export to parquet
Next
From: Aleš Zelený
Date:
Subject: Database cluster binary compatibility accross CPU platforms