public inbox for [email protected]  
help / color / mirror / Atom feed
From: Chao Li <[email protected]>
To: Fujii Masao <[email protected]>
Cc: Jim Jones <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Show comments in \dRp+, \dRs+, and \dX+ psql meta-commands
Date: Thu, 26 Feb 2026 14:13:44 +0800
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <CAHGQGwGL4JqiKA26fnGx-cTM=VzoTs_uzqejvj4Fawyr4uLUUw@mail.gmail.com>
	<[email protected]>
	<CAHGQGwFJKg-aT5vajSU1v_B4K129u_SjZ3EGGHFSBhW967gcMA@mail.gmail.com>
	<[email protected]>



> On Feb 26, 2026, at 13:07, Chao Li <[email protected]> wrote:
> 
> 
> 
>> On Feb 26, 2026, at 11:32, Fujii Masao <[email protected]> wrote:
>> 
>> 
>>> One unrelated thing caught my attention though: NULLs and empty strings
>>> are both displayed as NULL, which is expected according to
>>> CreateComments() in comment.c
>>> 
>>> ...
>>> /* Reduce empty-string to NULL case */
>>> if (comment != NULL && strlen(comment) == 0)
>>> comment = NULL;
>>> ...
>>> 
>>> However, I couldn't find anything in the docs that clearly says that
>>> it's going to be the case -- at least not in comment.sgml.
>>> 
>>> CREATE SEQUENCE s1;
>>> COMMENT ON SEQUENCE s1 IS '';
>>> CREATE SEQUENCE s2;
>>> COMMENT ON SEQUENCE s2 IS NULL;
>>> 
>>> postgres=# \ds+
>>> List of sequences
>>> -[ RECORD 1 ]-----------
>>> Schema      | public
>>> Name        | s1
>>> Type        | sequence
>>> Owner       | jim
>>> Persistence | permanent
>>> Size        | 8192 bytes
>>> Description | (null)
>>> -[ RECORD 2 ]-----------
>>> Schema      | public
>>> Name        | s2
>>> Type        | sequence
>>> Owner       | jim
>>> Persistence | permanent
>>> Size        | 8192 bytes
>>> Description | (null)
>>> 
>>> Is it perhaps an undocumented behaviour?
>> 
>> I'm not sure why this behavior isn't documented, but it seems worth
>> addressing in a separate documentation patch.
>> 
> 
> Actually, I am right about to post a doc patch for that. I noticed that while reviewing the other patch about comment before the holiday vacation. My patch will be out today or tomorrow.
> 
> Best regards,
> --
> Chao Li (Evan)
> HighGo Software Co., Ltd.
> https://www.highgo.com/
> 

Hi Fujii-san,

This is the tiny patch to enhance the doc of COMMON ON command. Would you please take a look? Thanks a lot.

https://www.postgresql.org/message-id/26476097-B1C1-4BA8-AA92-0AD0B8EC7190%40gmail.com

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/










view thread (10+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Show comments in \dRp+, \dRs+, and \dX+ psql meta-commands
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox