Re: doc: Clarify that empty COMMENT string removes the comment - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: doc: Clarify that empty COMMENT string removes the comment
Date
Msg-id CAKFQuwas4pN=NpSBf3nxhTxF8botOwGWdqF8rjyb=pBe72QGJQ@mail.gmail.com
Whole thread
In response to Re: doc: Clarify that empty COMMENT string removes the comment  (Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>)
List pgsql-hackers
On Thursday, February 26, 2026, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> wrote:
On Thu, Feb 26, 2026 at 9:27 PM David G. Johnston
<david.g.johnston@gmail.com> wrote:
>

>
> diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml
> index 8d81244910b..45d39e1fc45 100644
> --- a/doc/src/sgml/ref/comment.sgml
> +++ b/doc/src/sgml/ref/comment.sgml
> @@ -66,7 +66,7 @@ COMMENT ON
>    TRIGGER <replaceable class="parameter">trigger_name</replaceable> ON <replaceable class="parameter">table_name</replaceable> |
>    TYPE <replaceable class="parameter">object_name</replaceable> |
>    VIEW <replaceable class="parameter">object_name</replaceable>
> -} IS { <replaceable class="parameter">string_literal</replaceable> | NULL }
> +} IS { <replaceable class="parameter">string_literal</replaceable> | '' | NULL }
>

There are other ways to specify an empty string e.g $$$$. I don't
think we want to list all of them here.

We don’t, but we get the intended benefit by listing the by far most likely way anyone would actually write an empty string here.  The comment within string_literal covers any edge cases sufficiently.  The ‘’ can behave as a label of sorts just like “string_literal”.

I haven’t looked for similar precedent for this idea though and don’t feel strongly that we need to introduce it here, just something to consider to make the most read portion of any reference chapter imply this behavior.

David J.

pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: doc: Clarify that empty COMMENT string removes the comment
Next
From: Chao Li
Date:
Subject: Re: doc: Clarify that empty COMMENT string removes the comment