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

Tatsuro Yamada <yamatattsu@gmail.com>

From: Tatsuro Yamada <yamatattsu@gmail.com>
To: Álvaro Herrera <alvherre@kurilemu.de>
Cc: Chao Li <li.evan.chao@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Jim Jones <jim.jones@uni-muenster.de>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2026-01-21T08:46:45Z
Lists: pgsql-hackers

Attachments

Hi Álvaro and all,

> The next patch will include the following two fixes:
>   - Display all constraint types in full and in lowercase.
>   - Add test cases for temporal constraints.

The above two issues have been addressed in the V7 patch.
Below is an example output.

                             List of constraints
 Schema |      Table      |    Type     |                Name
--------+-----------------+-------------+------------------------------------
 public | temporal_con_fk | foreign key | temporal_con_fk_p_id_valid_at_fkey
 public | temporal_con_pk | not-null    | temporal_con_pk_id_not_null
 public | temporal_con_pk | not-null    | temporal_con_pk_valid_at_not_null
 public | temporal_con_pk | primary key | temporal_con_pk_pkey
 public | temporal_con_uq | unique      | temporal_con_uq_id_valid_at_key
(5 rows)

Please find the attached file.

Regards,
Tatsuro Yamada