Re: When to use COMMENT vs --

From: John McKown <john(dot)archie(dot)mckown(at)gmail(dot)com>
To: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: When to use COMMENT vs --
Date: 2016-12-07 16:10:30
Message-ID: CAAJSdjg5XuquNDO9jymPhLJfCzqs2AuYZ7nfqYwzMdBtmg-fCQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Dec 7, 2016 at 9:57 AM, Rich Shepard <rshepard(at)appl-ecosys(dot)com>
wrote:

> I have used '-- ' to enter comments about tables or columns and am
> curious
> about the value of storing comments in tables using the COMMENT key word.
> When is the latter more appropriate than the former?
>
> TIA,
>
> Rich

​-- is a comment which is like a language comment: it has _no_ effect on
the program being compiled. Likewise -- ​

​is simply ignored. The value in a COMMENT is actually stored in the data
base. For example:


tsh009=# comment on schema racf is 'Snapshot of z/OS RACF database via
IRRDBU00 output';
COMMENT
tsh009=# \dn+
List of schemas
Name | Owner | Access privileges | Description

--------+----------+----------------------+----------------------------------------------------
dasd | tsh009 | |
junk | tsh009 | |
public | postgres | postgres=UC/postgres+| standard public schema
| | =UC/postgres |
racf | tsh009 | | Snapshot of z/OS RACF database
via IRRDBU00 output
tape | tsh009 | |
tmc | tsh009 | |
(6 rows)


--
Heisenberg may have been here.

Unicode: http://xkcd.com/1726/

Maranatha! <><
John McKown

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Chris Travers 2016-12-07 16:12:08 Re: When to use COMMENT vs --
Previous Message Karsten Hilbert 2016-12-07 16:05:56 Re: When to use COMMENT vs --