PostgreSQL 8.2.3 婺桺桺懼
劯锔媆锔媆誕嬉誕

COMMENT

劉䓄

COMMENT -- 垔幬潡蔙櫹埻婔婻凹茇䔇臇濘

臺濘

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)㔗

埗昄

object_name
table_name.column_name
agg_name
constraint_name
func_name
op
rule_name
trigger_name

襕媹噖臇濘䔇凹茇劉䓄㔗臘㔕蕔镖㔕嘘㔕庘昄㔕䘵嚘㔕淉嘩严㔕淉嘩严䌂㔕废彖㔕䌂傋㔕蓖商劉庖埇傖橬昇嚟媞閄㔗

agg_type

蕔镖庘昄淉嘩䔇埗昄䌂傋襕嚘䫘婔婻镽埗昄蕔镖庘昄埇傖嘪䫘 * 傼敪膷噖昄扞䌂傋彖臘㔗

sourcetype

䌂傋蘸扵䔇溊昄扞䌂傋

targettype

䌂傋蘸扵䔇䕞湺昄扞䌂傋

argmode

庘昄埗昄䔇昇嚟 IN(䚺䩕), OUT, INOUT 㔗臙濘懟 COMMENT ON FUNCTION 垂鍙婪婉嚔濘懟 OUT 埗昄啹婺埻襕橬膷噖埗昄儌埇傖彴桺庘昄䔇躆傘庖㔗啹溴埻襕彖庺 ININOUT 埗昄儌轿崘庖㔗

argname

庘昄埗昄䔇劉庖㔗臙濘懟 COMMENT ON FUNCTION 垂鍙婪幽婉噿媄埗昄劉啹婺埻襕橬埗昄䔇昄扞䌂傋儌埇傖彴桺庘昄䔇躆傘㔗

argtype

套悩橬䔇臺滇庘昄埗昄䔇昄扞䌂傋(埇傖䫘昇嚟媞閄)

large_object_oid

崓凹茇䔇 OID

PROCEDURAL

認婻庖澇橬傂嘘䫘崇

text

桄䔇臇濘傖庖严婾桺橸䔇桹嚟喍套悩滇 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';

噚垹攓

SQL 湺庖麯澇橬 COMMENT 变傴㔗


劯锔饡釕嬉誕
CLUSTER婪婔亓COMMIT