patch: Allow \dd to show constraint comments - Mailing list pgsql-hackers

From Josh Kupershmidt
Subject patch: Allow \dd to show constraint comments
Date
Msg-id BANLkTim32qWx_6dqcU6mMspEhyc6ZQLgcA@mail.gmail.com
Whole thread Raw
Responses Re: patch: Allow \dd to show constraint comments  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Hi all,

Attached is a simple patch addressing the TODO item "Allow \dd to show
constraint comments". If you have comments on various constraints
(column, foreign key, primary key, unique, exclusion), they should
show up via \dd now.

Some example SQL is attached to create two tables with a variety of
constraints and constraint comments. With the patch, \dd should then
produce something like this:

                            Object descriptions
 Schema |         Name         |   Object   |         Description
--------+----------------------+------------+------------------------------
 public | bar_c_excl           | constraint | exclusion constraint comment
 public | bar_pkey             | constraint | two column pkey comment
 public | bar_uname_check      | constraint | constraint for bar
 public | bar_uname_fkey       | constraint | fkey comment
 public | uname_check_not_null | constraint | not null comment
 public | uname_cons           | constraint | sanity check for uname
 public | uname_uniq_cons      | constraint | unique constraint comment
(7 rows)

whereas without the patch, you should see nothing.

Josh

Attachment

pgsql-hackers by date:

Previous
From: Cédric Villemain
Date:
Subject: Re: cache estimates, cache access cost
Next
From: Alvaro Herrera
Date:
Subject: LOCK DATABASE