Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
9935a85f
Commit
9935a85f
authored
23 years ago
by
Tom Lane
Browse files
Options
Downloads
Patches
Plain Diff
Document obj_description and col_description functions; expand
description of COMMENT command.
parent
44d1e9d5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/src/sgml/func.sgml
+63
-3
63 additions, 3 deletions
doc/src/sgml/func.sgml
doc/src/sgml/ref/comment.sgml
+22
-4
22 additions, 4 deletions
doc/src/sgml/ref/comment.sgml
with
85 additions
and
7 deletions
doc/src/sgml/func.sgml
+
63
−
3
View file @
9935a85f
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.8
8
2001/12/2
3
2
0:22:49
tgl Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.8
9
2001/12/2
7
2
1:36:57
tgl Exp $
PostgreSQL documentation
-->
...
...
@@ -2643,7 +2643,7 @@ PostgreSQL documentation
<row>
<entry><function>current_timestamp</function></entry>
<entry><type>timestamp</type></entry>
<entry>
d
ate and time; see
also
<link
<entry>
D
ate and time; see <link
linkend="functions-datetime-current">below</link>
</entry>
<entry></entry>
...
...
@@ -2722,7 +2722,7 @@ PostgreSQL documentation
<entry><function>now</function>()</entry>
<entry><type>timestamp</type></entry>
<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>
</entry>
<entry></entry>
...
...
@@ -4399,6 +4399,66 @@ SELECT NULLIF(value, '(none)') ...
<structfield>usesysid</> value.
</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>
...
...
This diff is collapsed.
Click to expand it.
doc/src/sgml/ref/comment.sgml
+
22
−
4
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
-->
...
...
@@ -98,12 +98,30 @@ COMMENT
Description
</title>
<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
<command>\dd</command>, <command>\d+</command>, or <command>\l+</command> commands.
To remove a comment, write <literal>NULL</literal>.
<command>\dd</command>, <command>\d+</command>, or <command>\l+</command>
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.
</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 id="R1-SQL-COMMENT-2">
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment