shobj_description()

A function returning a shared object's comment

shobj_description() is a system function returning the comment for a shared object

shobj_description() was added in PostgreSQL 8.2.

Usage

shobj_description ( object oid, catalog name ) → text

Given an OID and the name of the appropriate system catalog table, shobj_description() returns the comment for the shared object (as defined by COMMENT ON), or NULL if no comment has been specified.

Change history

Examples

postgres=# COMMENT ON TABLESPACE tblspc_2 IS 'Store a few of the things';
COMMENT

postgres=# SELECT shobj_description(
                 (SELECT oid FROM pg_tablespace WHERE spcname = 'tblspc_2'),
                 'pg_tablespace');
     shobj_description     
---------------------------
 Store a few of the things
(1 row)

Categories

System catalogue, System function

See also

COMMENT ON, pg_shdescription, obj_description()