Re: When to use COMMENT vs --

From: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: When to use COMMENT vs --
Date: 2016-12-07 16:05:56
Message-ID: 20161207160555.o3y3iydu62pfvkyo@hermes.hilbert.loc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Dec 07, 2016 at 07:57:54AM -0800, Rich Shepard 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?

"--" only means "comment" to SQL code (such as in scripts).
PostgreSQL itself simply ignores it.

OTOH, using "comment on ... is ..." tells PostgreSQL to
_store_ a comment on a database object for later retrieval.

Karsten
--
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John McKown 2016-12-07 16:10:30 Re: When to use COMMENT vs --
Previous Message Pavel Stehule 2016-12-07 16:04:42 Re: When to use COMMENT vs --