Contents
obj_description()
A function returning an object's comment
obj_description()
is a system function returning an object's comment.
obj_description()
was added in PostgreSQL 6.3.
Usage
obj_description (object
oid
,catalog
name ) →text
obj_description (object
oid
) →text
Given an OID and the name of the appropriate system catalog table, obj_description()
retuns the comment for the object (as defined by COMMENT ON
), or NULL
if no comment has been specified.
Note that the form obj_description ( object oid )
is deprecated as there is no guarantee that a particular OID is unique to a particular system catalog table.
Change history
- PostgreSQL 7.2
obj_description ( object oid, catalog name )
variant added (commit bf56f075)
- PostgreSQL 6.3
- added (commit 4cbc06cf)
Examples
postgres=# CREATE TABLE foo (id int, val text); CREATE TABLE postgres=# COMMENT ON TABLE foo IS 'Store all the things'; COMMENT postgres=# SELECT obj_description('foo'::regclass, 'pg_class'); obj_description ---------------------- Store all the things (1 row)
References
- PostgreSQL documentation: Comment Information Functions