Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
9935a85f
Commit
9935a85f
authored
Dec 27, 2001
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document obj_description and col_description functions; expand
description of COMMENT command.
parent
44d1e9d5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
7 deletions
+85
-7
doc/src/sgml/func.sgml
doc/src/sgml/func.sgml
+63
-3
doc/src/sgml/ref/comment.sgml
doc/src/sgml/ref/comment.sgml
+22
-4
No files found.
doc/src/sgml/func.sgml
View file @
9935a85f
<!--
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.8
8 2001/12/23 20:22:49
tgl Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.8
9 2001/12/27 21:36:57
tgl Exp $
PostgreSQL documentation
PostgreSQL documentation
-->
-->
...
@@ -2643,7 +2643,7 @@ PostgreSQL documentation
...
@@ -2643,7 +2643,7 @@ PostgreSQL documentation
<row>
<row>
<entry><function>current_timestamp</function></entry>
<entry><function>current_timestamp</function></entry>
<entry><type>timestamp</type></entry>
<entry><type>timestamp</type></entry>
<entry>
date and time; see also
<link
<entry>
Date and time; see
<link
linkend="functions-datetime-current">below</link>
linkend="functions-datetime-current">below</link>
</entry>
</entry>
<entry></entry>
<entry></entry>
...
@@ -2722,7 +2722,7 @@ PostgreSQL documentation
...
@@ -2722,7 +2722,7 @@ PostgreSQL documentation
<entry><function>now</function>()</entry>
<entry><function>now</function>()</entry>
<entry><type>timestamp</type></entry>
<entry><type>timestamp</type></entry>
<entry>Current date and time (equivalent to
<entry>Current date and time (equivalent to
<function>current_timestamp</function>); see
also
<link
<function>current_timestamp</function>); see <link
linkend="functions-datetime-current">below</link>
linkend="functions-datetime-current">below</link>
</entry>
</entry>
<entry></entry>
<entry></entry>
...
@@ -4399,6 +4399,66 @@ SELECT NULLIF(value, '(none)') ...
...
@@ -4399,6 +4399,66 @@ SELECT NULLIF(value, '(none)') ...
<structfield>usesysid</> value.
<structfield>usesysid</> value.
</para>
</para>
<table>
<title>Comment Information Functions</>
<tgroup cols="3">
<thead>
<row><entry>Name</> <entry>Return Type</> <entry>Description</></row>
</thead>
<tbody>
<row>
<entry><function>obj_description</>(<parameter>objectOID</parameter>, <parameter>tablename</>)</entry>
<entry><type>text</></entry>
<entry>Get comment for a database object</>
</row>
<row>
<entry><function>obj_description</>(<parameter>objectOID</parameter>)</entry>
<entry><type>text</></entry>
<entry>Get comment for a database object (<emphasis>deprecated</>)</entry>
</row>
<row>
<entry><function>col_description</>(<parameter>tableOID</parameter>, <parameter>columnnumber</>)</entry>
<entry><type>text</></entry>
<entry>Get comment for a table column</>
</row>
</tbody>
</tgroup>
</table>
<indexterm zone="functions-misc">
<primary>obj_description</primary>
</indexterm>
<indexterm zone="functions-misc">
<primary>col_description</primary>
</indexterm>
<para>
These functions extract comments previously stored with the
<command>COMMENT</> command. <literal>NULL</> is returned if
no comment can be found matching the specified parameters.
</para>
<para>
The two-parameter form of <function>obj_description()</> returns the
comment for a database object specified by its OID and the name of the
containing system catalog. For example,
<literal>obj_description(123456,'pg_class')</>
would retrieve the comment for a table with OID 123456.
The one-parameter form of <function>obj_description()</> requires only
the object OID. It is now deprecated since there is no guarantee that
OIDs are unique across different system catalogs; therefore, the wrong
comment could be returned.
</para>
<para>
<function>col_description()</> returns the comment for a table column,
which is specified by the OID of its table and its column number.
<function>obj_description()</> cannot be used for table columns since
columns do not have OIDs of their own.
</para>
</sect1>
</sect1>
...
...
doc/src/sgml/ref/comment.sgml
View file @
9935a85f
<!--
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/comment.sgml,v 1.1
1 2001/12/08 03:24:34 thomas
Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/comment.sgml,v 1.1
2 2001/12/27 21:36:57 tgl
Exp $
PostgreSQL documentation
PostgreSQL documentation
-->
-->
...
@@ -98,12 +98,30 @@ COMMENT
...
@@ -98,12 +98,30 @@ COMMENT
Description
Description
</title>
</title>
<para>
<para>
<command>COMMENT</command> adds a comment to an object that can be
<command>COMMENT</command> stores a comment about a database object.
Comments can be
easily retrieved with <command>psql</command>'s
easily retrieved with <command>psql</command>'s
<command>\dd</command>, <command>\d+</command>, or <command>\l+</command> commands.
<command>\dd</command>, <command>\d+</command>, or <command>\l+</command>
To remove a comment, write <literal>NULL</literal>.
commands. Other user interfaces to retrieve comments can be built atop
the same built-in functions that <command>psql</command> uses, namely
<function>obj_description()</> and <function>col_description()</>.
</para>
<para>
To modify a comment, issue a new <command>COMMENT</> command for the
same object. Only one comment string is stored for each object.
To remove a comment, write <literal>NULL</literal> in place of the text
string.
Comments are automatically dropped when the object is dropped.
Comments are automatically dropped when the object is dropped.
</para>
</para>
<para>
It should be noted that there is presently no security mechanism
for comments: any user connected to a database can see all the comments
for objects in that database (although only superusers can change
comments for objects that they don't own). Therefore, don't put
security-critical information in comments.
</para>
</refsect1>
</refsect1>
<refsect1 id="R1-SQL-COMMENT-2">
<refsect1 id="R1-SQL-COMMENT-2">
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment