obj_description() is a system function returning an object's comment.
obj_description() was added in PostgreSQL 6.3.
catalogname ) →
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.
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)