| From: | Tatsuro Yamada <yamatattsu(at)gmail(dot)com> |
|---|---|
| To: | Álvaro Herrera <alvherre(at)kurilemu(dot)de> |
| Cc: | Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, 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> |
| Subject: | Re: [PATCH] psql: add \dcs to list all constraints |
| Date: | 2026-01-22 13:03:52 |
| Message-ID: | CAOKkKFuL-VGw+hUSdXwwnONB=t4BU+x6OJ38ian4XgJNDStAZg@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi Chao, Álvaro, and all,
>>I agree with another reviewer that said that having exec_command_d()
>>check only the third char is kinda pointless. Just let
>>listConstraints() check everything seems easiest and more consistent.
>
>As I mentioned in a previous email, the reason exec_command_d() only
>checks the third character is that it follows the same implementation
>pattern as other existing commands.
>
>While I agree that this could be improved, since the current behavior is
>consistent with other commands, I do not consider it critical at the moment.
>If I were to change it, I would likely postpone that improvement to a later
>patch.
After reviewing the code, I realized that the comment about passing
everything to listconstraints() instead of just checking the third string
was correct. Therefore, I updated the code accordingly.
Thanks to Chao and Alvaro for their comments.
I created the new patch (v8).
Other fixes included:
- Updated the documentation to clarify what the pattern string matches.
- Modified the case statement to use a predefined variable when converting
contypes to strings.
Please find the attached file.
Thanks,
Tatsuro Yamada
| Attachment | Content-Type | Size |
|---|---|---|
| v8-0001-Add-list-constraints-meta-command-dCN-on-psql.patch | application/octet-stream | 42.1 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Konstantin Knizhnik | 2026-01-22 13:45:09 | Re: Mystery with REVOKE PRIVILEGE |
| Previous Message | Chao Li | 2026-01-22 12:59:31 | Re: Assert the timestamp is available for ORIGN_DIFFERS conflicts |