Re: [PATCH] psql: add \dcs to list all constraints
Chao Li <li.evan.chao@gmail.com>
From: Chao Li <li.evan.chao@gmail.com>
To: Tatsuro Yamada <yamatattsu@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Jim Jones <jim.jones@uni-muenster.de>, pgsql-hackers <pgsql-hackers@postgresql.org>, Álvaro Herrera <alvherre@kurilemu.de>
Date: 2026-01-15T10:49:15Z
Lists: pgsql-hackers
> On Jan 15, 2026, at 17:53, Chao Li <li.evan.chao@gmail.com> wrote: > > > >> On Jan 15, 2026, at 17:20, Tatsuro Yamada <yamatattsu@gmail.com> wrote: >> >> Hi Chao-san, >> >> Thanks for your comments! >> >> On Thu, Jan 15, 2026 at 4:20 PM Chao Li <li.evan.chao@gmail.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/