Re: Show comments in \dRp+, \dRs+, and \dX+ psql meta-commands - Mailing list pgsql-hackers

From Chao Li
Subject Re: Show comments in \dRp+, \dRs+, and \dX+ psql meta-commands
Date
Msg-id 5BBBA7F3-2268-4E0C-96D7-59AA664699C0@gmail.com
Whole thread Raw
In response to Re: Show comments in \dRp+, \dRs+, and \dX+ psql meta-commands  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: Show comments in \dRp+, \dRs+, and \dX+ psql meta-commands
List pgsql-hackers

> On Feb 26, 2026, at 11:32, Fujii Masao <masao.fujii@gmail.com> 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
beforethe holiday vacation. My patch will be out today or tomorrow. 

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







pgsql-hackers by date:

Previous
From: Ashutosh Sharma
Date:
Subject: Re: synchronized_standby_slots behavior inconsistent with quorum-based synchronous replication
Next
From: Andrey Borodin
Date:
Subject: Re: amcheck: add index-all-keys-match verification for B-Tree