comment.7

来自「PostgreSQL 8.2中增加了很多企业用户所需要的功能和性能上的提高,其开」· 7 代码 · 共 169 行

7
169
字号
.\\" auto-generated by docbook2man-spec $Revision: 1.1.1.1 $.TH "COMMENT" "" "2008-01-03" "SQL - Language Statements" "SQL Commands".SH NAMECOMMENT \- define or change the comment of an object.SH SYNOPSIS.sp.nfCOMMENT ON{  TABLE \fIobject_name\fR |  COLUMN \fItable_name\fR.\fIcolumn_name\fR |  AGGREGATE \fIagg_name\fR (\fIagg_type\fR [, ...] ) |  CAST (\fIsourcetype\fR AS \fItargettype\fR) |  CONSTRAINT \fIconstraint_name\fR ON \fItable_name\fR |  CONVERSION \fIobject_name\fR |  DATABASE \fIobject_name\fR |  DOMAIN \fIobject_name\fR |  FUNCTION \fIfunc_name\fR ( [ [ \fIargmode\fR ] [ \fIargname\fR ] \fIargtype\fR [, ...] ] ) |  INDEX \fIobject_name\fR |  LARGE OBJECT \fIlarge_object_oid\fR |  OPERATOR \fIop\fR (\fIleftoperand_type\fR, \fIrightoperand_type\fR) |  OPERATOR CLASS \fIobject_name\fR USING \fIindex_method\fR |  [ PROCEDURAL ] LANGUAGE \fIobject_name\fR |  ROLE \fIobject_name\fR |  RULE \fIrule_name\fR ON \fItable_name\fR |  SCHEMA \fIobject_name\fR |  SEQUENCE \fIobject_name\fR |  TABLESPACE \fIobject_name\fR |  TRIGGER \fItrigger_name\fR ON \fItable_name\fR |  TYPE \fIobject_name\fR |  VIEW \fIobject_name\fR} IS \fI'text'\fR.sp.fi.SH "DESCRIPTION".PP\fBCOMMENT\fR stores a comment about a database object..PPTo modify a comment, issue a new \fBCOMMENT\fR command for thesame object. Only one comment string is stored for each object.To remove a comment, write NULL in place of the textstring.Comments are automatically dropped when the object is dropped..PPComments can beeasily retrieved with the \fBpsql\fR commands\fB\\dd\fR, \fB\\d+\fR, and \fB\\l+\fR.Other user interfaces to retrieve comments can be built atopthe same built-in functions that \fBpsql\fR uses, namely\fBobj_description\fR, \fBcol_description\fR,and \fBshobj_description\fR (see in the documentation)..SH "PARAMETERS".TP\fB\fIobject_name\fB\fR.TP\fB\fItable_name.column_name\fB\fR.TP\fB\fIagg_name\fB\fR.TP\fB\fIconstraint_name\fB\fR.TP\fB\fIfunc_name\fB\fR.TP\fB\fIop\fB\fR.TP\fB\fIrule_name\fB\fR.TP\fB\fItrigger_name\fB\fRThe name of the object to be commented. Names of tables,aggregates, domains, functions, indexes, operators, operator classes,sequences, types, and views may be schema-qualified..TP\fB\fIagg_type\fB\fRAn input data type on which the aggregate function operates.To reference a zero-argument aggregate function, write *in place of the list of input data types..TP\fB\fIsourcetype\fB\fRThe name of the source data type of the cast..TP\fB\fItargettype\fB\fRThe name of the target data type of the cast..TP\fB\fIargmode\fB\fRThe mode of a function argument: either IN, OUT,or INOUT. If omitted, the default is IN.Note that \fBCOMMENT ON FUNCTION\fR does not actually payany attention to OUT arguments, since only the inputarguments are needed to determine the function's identity.So it is sufficient to list the IN and INOUTarguments..TP\fB\fIargname\fB\fRThe name of a function argument.Note that \fBCOMMENT ON FUNCTION\fR does not actually payany attention to argument names, since only the argument datatypes are needed to determine the function's identity..TP\fB\fIargtype\fB\fRThe data type(s) of the function's arguments (optionally schema-qualified), if any..TP\fB\fIlarge_object_oid\fB\fRThe OID of the large object..TP\fBPROCEDURAL\fRThis is a noise word..TP\fB\fItext\fB\fRThe new comment, written as a string literal; or NULLto drop the comment..SH "NOTES".PPThere is presently no security mechanism for comments: any userconnected to a database can see all the comments for objects inthat database (although only superusers can change comments forobjects that they don't own). For shared objects such asdatabases, roles, and tablespaces comments are stored globallyand any user connected to any database can see all the commentsfor shared objects. Therefore, don't put security-criticalinformation in comments..SH "EXAMPLES".PPAttach a comment to the table mytable:.sp.nfCOMMENT ON TABLE mytable IS 'This is my table.';.sp.fiRemove it again:.sp.nfCOMMENT ON TABLE mytable IS NULL;.sp.fi.PPSome more examples:.sp.nfCOMMENT 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';.sp.fi.SH "COMPATIBILITY".PPThere is no \fBCOMMENT\fR command in the SQL standard.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?