Re: [PATCH] psql: add \dcs to list all constraints

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Tatsuro Yamada <yamatattsu(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Álvaro Herrera <alvherre(at)kurilemu(dot)de>
Subject: Re: [PATCH] psql: add \dcs to list all constraints
Date: 2026-01-15 10:49:15
Message-ID: AE74F853-3CCC-4171-BB93-6196598E06EC@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Jan 15, 2026, at 17:53, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> wrote:
>
>
>
>> On Jan 15, 2026, at 17:20, Tatsuro Yamada <yamatattsu(at)gmail(dot)com> wrote:
>>
>> Hi Chao-san,
>>
>> Thanks for your comments!
>>
>> On Thu, Jan 15, 2026 at 4:20 PM Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> wrote:
>>
>>> 3
>>> ```
>>> ---- \dCN doesn't show constraints related to domain,
>>> ---- since \dD can be used to check them
>>> ```
>>>
>>> I saw this in the test script, should we mention that in the doc change?
>>
>> Tom also commented on constraints related to domains, and I would like to
>> discuss and decide whether to include them in the \dCN command.
>>
>> Depending on the decision, I am considering the following changes:
>>
>> - If they are included:
>> - Remove the above test case from the regression tests
>> - If they are not included:
>> - Add the reason for excluding them to the documentation
>>
>> Which do you think is better? Should domain constraints be covered by \dCN?
>> I would appreciate your feedback.
>
> I had a feeling while reviewing the patch but I didn’t raise it because I was not firm minded. As you ask, this is just my personal opinion, you may ignore if you don’t consider reasonable.
>
> This patch claims “constraints”, but it actually only shows table constraints. How, we can see the code comment says "Describes constraints”, the command message says "List of constraints”, I think that’s where the discussion came from.
>
> Maybe an easy way to go is something like renaming the command to \dTCN, making it specific to table constraints.

I just want to add that, I am not sure if “table constraints” is a proper group, and I didn’t intend to suggest a new command name as \dTCN. My point was to make the feature scope more specific, and make the command name better reflect to the scope.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2026-01-15 11:21:56 Re: PL/Python initialization cleanup
Previous Message Álvaro Herrera 2026-01-15 10:47:51 Re: remove the unneeded header file math.h in binaryheap.c