]> granicus.if.org Git - postgresql/blob - doc/src/sgml/ref/comment.sgml
Add documentation for comment.
[postgresql] / doc / src / sgml / ref / comment.sgml
1 <!--
2 $Header: /cvsroot/pgsql/doc/src/sgml/ref/comment.sgml,v 1.1 1999/10/26 03:48:58 momjian Exp $
3 Postgres documentation
4 -->
5
6 <refentry id="SQL-COMMENT">
7  <refmeta>
8   <refentrytitle id="SQL-COMMENT-TITLE">
9    COMMENT
10   </refentrytitle>
11   <refmiscinfo>SQL - Language Statements</refmiscinfo>
12  </refmeta>
13  <refnamediv>
14   <refname>
15    COMMENT
16   </refname>
17   <refpurpose>
18    Add comment to an object
19   </refpurpose>
20  </refnamediv>
21  <refsynopsisdiv>
22   <refsynopsisdivinfo>
23    <date>1999-07-20</date>
24   </refsynopsisdivinfo>
25   <synopsis>
26 COMMENT ON
27 [
28   [ DATABASE | INDEX | RULE | SEQUENCE | TABLE | TYPE | VIEW ]
29   <replaceable class="PARAMETER">object_name</replaceable> |
30   COLUMN <replaceable class="PARAMETER">table_name</replaceable>.<replaceable class="PARAMETER">column_name</replaceable>|
31   AGGREGATE <replaceable class="PARAMETER">agg_name</replaceable> <replaceable class="PARAMETER">agg_type</replaceable>|
32   FUNCTION <replaceable class="PARAMETER">func_name</replaceable> (<replaceable class="PARAMETER">arg1</replaceable>, <replaceable class="PARAMETER">arg2</replaceable>, ...)|
33   OPERATOR <replaceable class="PARAMETER">op</replaceable> (<replaceable class="PARAMETER">leftoperand_type</replaceable> <replaceable class="PARAMETER">rightoperand_type</replaceable>) |
34   TRIGGER <replaceable class="PARAMETER">trigger_name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable>
35 ] IS <replaceable class="PARAMETER">'text'</replaceable>
36   </synopsis>
37   
38   <refsect2 id="R2-SQL-COMMENT-1">
39    <refsect2info>
40     <date>1999-10-25</date>
41    </refsect2info>
42    <title>
43     Inputs
44    </title>
45    <para>
46
47     <variablelist>
48      <varlistentry>
49       <term><replaceable class="PARAMETER">object_name, table_name,
50       column_name, agg_name, func_name, op, trigger_name</replaceable></term>
51       <listitem>
52        <para>
53         The name of the object to be be commented.
54        </para>
55       </listitem>
56      </varlistentry>
57      <varlistentry>
58       <term><replaceable class="PARAMETER">text</replaceable></term>
59       <listitem>
60        <para>
61         The comment to add.
62        </para>
63       </listitem>
64      </varlistentry>
65     </variablelist>
66    </para>
67   </refsect2>
68   
69   <refsect2 id="R2-SQL-COMMENT-2">
70    <refsect2info>
71     <date>1998-09-08</date>
72    </refsect2info>
73    <title>
74     Outputs
75    </title>
76    <para>
77
78     <variablelist>
79      <varlistentry>
80       <term><computeroutput>
81 COMMENT
82        </computeroutput></term>
83       <listitem>
84        <para>
85         Message returned if the table is successfully commented.
86        </para>
87       </listitem>
88      </varlistentry>
89     </variablelist>
90    </para>
91   </refsect2>
92  </refsynopsisdiv>
93
94  <refsect1 id="R1-SQL-COMMENT-1">
95   <refsect1info>
96    <date>1998-10-25</date>
97   </refsect1info>
98   <title>
99    Description
100   </title>
101   <para>
102    <command>COMMENT</command> adds a comment to an object that can be 
103     easily retrieved with <application>psql's</application>
104     <emphasize>\dd</emphasize> command.
105     To remove a comment, use <literal>''</literal>.
106   </para>
107  </refsect1>
108
109  <refsect1 id="R1-SQL-COMMENT-2">
110   <title>
111    Usage
112   </title>
113   <para>
114    comment the table <literal>mytable</literal>:
115
116    <programlisting>
117 COMMENT ON mytable IS 'This is my table.';
118    </programlisting>
119   </para>
120  </refsect1>
121  
122  <refsect1 id="R1-SQL-COMMENT-3">
123   <title>
124    Compatibility
125   </title>
126   
127   <refsect2 id="R2-SQL-COMMENT-4">
128    <refsect2info>
129     <date>1998-09-08</date>
130    </refsect2info>
131    <title>
132     SQL92
133    </title>
134    <para>
135     There is no <command>COMMENT</command> in <acronym>SQL92</acronym>.
136    </para>
137   </refsect2>
138  </refsect1>
139 </refentry>
140
141 <!-- Keep this comment at the end of the file
142 Local variables:
143 mode: sgml
144 sgml-omittag:t
145 sgml-shorttag:t
146 sgml-minimize-attributes:nil
147 sgml-always-quote-attributes:t
148 sgml-indent-step:1
149 sgml-indent-data:t
150 sgml-parent-document:nil
151 sgml-default-dtd-file:"../reference.ced"
152 sgml-exposed-tags:nil
153 sgml-local-catalogs:"/usr/lib/sgml/catalog"
154 sgml-local-ecat-files:nil
155 End:
156 -->