pg_describe_object()

A function returning a human-readable description of a database object

pg_describe_object() is a system function providing a human-readable description of a database object via its catalog OID, object OID, and possbile sub-object ID, as contained for example pg_depend.

pg_describe_object() was added in PostgreSQL 9.1.

Usage

pg_describe_object ( classid oid, objid oid, objsubid integer ) → text

Change history

Examples

Create an object with some dependencies:

postgres=# CREATE EXTENSION hstore_plperl CASCADE;
NOTICE:  installing required extension "hstore"
NOTICE:  installing required extension "plperl"
CREATE EXTENSION

Examining the created dependencies reflected in pg_depend:

postgres=# SELECT pg_describe_object(refclassid, refobjid, refobjsubid)
             FROM pg_depend
            WHERE objid = (SELECT oid FROM pg_extension WHERE extname='hstore_plperl');
 pg_describe_object 
--------------------
 extension plperl
 extension hstore
 schema public
(3 rows)

Categories

System catalogue, System function

See also

pg_get_object_address()