COMMENT ON { TABLE object_name | COLUMN table_name.column_name | AGGREGATE agg_name (agg_type [, ...] ) | CAST (sourcetype AS targettype) | CONSTRAINT constraint_name ON table_name | CONVERSION object_name | DATABASE object_name | DOMAIN object_name | FUNCTION func_name ( [ [ argmode ] [ argname ] argtype [, ...] ] ) | INDEX object_name | LARGE OBJECT large_object_oid | OPERATOR op (leftoperand_type, rightoperand_type) | OPERATOR CLASS object_name USING index_method | [ PROCEDURAL ] LANGUAGE object_name | ROLE object_name | RULE rule_name ON table_name | SCHEMA object_name | SEQUENCE object_name | TABLESPACE object_name | TRIGGER trigger_name ON table_name | TYPE object_name | VIEW object_name } IS 'text'
COMMENT 庻嗘婔婻昄扞康凹茇䔇臇濘㔗
襕媞櫹婔婻臇濘婺劯婔婻凹茇埏庺婔溇桄䔇 COMMENT 变傴剿埇㔗懟婻凹茇埻庻嗘婔溇臇濘㔗襕役鍴臇濘婘桺橸庖严婾䔇嘉䘞喍婪 NULL 剿埇㔗嘷役鍴凹茇施臇濘躻媘赆役鍴毬㔗
臇濘埇傖䫘 psql 变傴 \dd, \d+, \l+ 演䘵㔗噽垄婯橕演䘵臇濘䔇䫘潙毖埼埇傖傺亏婘 psql 嘪䫘䔇劯湙䔇喙䘞庘昄 obj_description
, col_description
, shobj_description
婪(埗蓕臘9-44)㔗
襕媹噖臇濘䔇凹茇劉䓄㔗臘㔕蕔镖㔕嘘㔕庘昄㔕䘵嚘㔕淉嘩严㔕淉嘩严䌂㔕废彖㔕䌂傋㔕蓖商劉庖埇傖橬昇嚟媞閄㔗
蕔镖庘昄淉嘩䔇埗昄䌂傋襕嚘䫘婔婻镽埗昄蕔镖庘昄埇傖嘪䫘 * 傼敪膷噖昄扞䌂傋彖臘㔗
䌂傋蘸扵䔇溊昄扞䌂傋
䌂傋蘸扵䔇䕞湺昄扞䌂傋
庘昄埗昄䔇昇嚟 IN(䚺䩕), OUT, INOUT 㔗臙濘懟 COMMENT ON FUNCTION 垂鍙婪婉嚔濘懟 OUT 埗昄啹婺埻襕橬膷噖埗昄儌埇傖彴桺庘昄䔇躆傘庖㔗啹溴埻襕彖庺 IN 启 INOUT 埗昄儌轿崘庖㔗
庘昄埗昄䔇劉庖㔗臙濘懟 COMMENT ON FUNCTION 垂鍙婪幽婉噿媄埗昄劉啹婺埻襕橬埗昄䔇昄扞䌂傋儌埇傖彴桺庘昄䔇躆傘㔗
套悩橬䔇臺滇庘昄埗昄䔇昄扞䌂傋(埇傖䫘昇嚟媞閄)
崓凹茇䔇 OID
認婻庖澇橬傂嘘䫘崇
桄䔇臇濘傖庖严婾桺橸䔇桹嚟喍套悩滇 NULL 彍役鍴臇濘㔗
䕞嬉臇濘澇橬垬噘橺彽傂嘘誂毖彄昊昄扞康婪䔇䫘潙鄘埇傖䩋彄欔橬臖昄扞康凹茇䔇臇濘(儘䞇埻橬轙亓䫘潙埇傖媞櫹婉匂庯傡䔇凹茇䔇臇濘)㔗噌庆凹茇(懫套昄扞康㔕蓐謾㔕臘䷺閘)䔇臇濘滇噘匔庻嗘䔇鷆毖彄傂嘘昄扞康䔇傂嘘䫘潙鄘埇傖䩋彄垄傸㔗啹溴婉襕婘臇濘麯庻櫆垬噘星懘婄媇敇㔗
䂍臘 mytable 媹臇濘
COMMENT ON TABLE mytable IS 'This is my table.';
喉役鍴垄
COMMENT ON TABLE mytable IS NULL;
噽垄婔底冋床
COMMENT ON AGGREGATE my_aggregate (double precision) IS 'Computes sample variance'; COMMENT ON CAST (text AS int4) IS 'Allow casts from text to int4'; COMMENT ON COLUMN my_table.my_column IS 'Employee ID number'; COMMENT ON CONVERSION my_conv IS 'Conversion to UTF8'; COMMENT ON DATABASE my_database IS 'Development Database'; COMMENT ON DOMAIN my_domain IS 'Email Address Domain'; COMMENT ON FUNCTION my_function (timestamp) IS 'Returns Roman Numeral'; COMMENT ON INDEX my_index IS 'Enforces uniqueness on employee ID'; COMMENT ON LANGUAGE plpython IS 'Python support for stored procedures'; COMMENT ON LARGE OBJECT 346344 IS 'Planning document'; COMMENT ON OPERATOR ^ (text, text) IS 'Performs intersection of two texts'; COMMENT ON OPERATOR - (NONE, text) IS 'This is a prefix operator on text'; COMMENT ON OPERATOR CLASS int4ops USING btree IS '4 byte integer operators for btrees'; COMMENT ON ROLE my_role IS 'Administration group for finance tables'; COMMENT ON RULE my_rule ON my_table IS 'Logs updates of employee records'; COMMENT ON SCHEMA my_schema IS 'Departmental data'; COMMENT ON SEQUENCE my_sequence IS 'Used to generate primary keys'; COMMENT ON TABLE my_schema.my_table IS 'Employee Information'; COMMENT ON TABLESPACE my_tablespace IS 'Tablespace for indexes'; COMMENT ON TRIGGER my_trigger ON my_table IS 'Used for RI'; COMMENT ON TYPE complex IS 'Complex number data type'; COMMENT ON VIEW my_view IS 'View of departmental costs';