Search Postgresql Archives

Re: When to use COMMENT vs --

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 7, 2016 at 9:57 AM, Rich Shepard <rshepard@xxxxxxxxxxxxxxx> 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.


Maranatha! <><
John McKown

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux