Re: patch: Allow \dd to show constraint comments

Поиск
Список
Период
Сортировка
Искать
От
Robert Haas
Тема
Re: patch: Allow \dd to show constraint comments
Дата
в 11:26:42
Msg-id
BANLkTikn5NSSTvzTP3SFrC6DVycUHEP3JA@mail.gmail.com
Ответ на
Список
Дерево обсуждения
patch: Allow \dd to show constraint comments Josh Kupershmidt <schmiddy@gmail.com>
Re: patch: Allow \dd to show constraint comments Robert Haas <robertmhaas@gmail.com>
Re: patch: Allow \dd to show constraint comments Josh Kupershmidt <schmiddy@gmail.com>
Re: patch: Allow \dd to show constraint comments Robert Haas <robertmhaas@gmail.com>
Re: patch: Allow \dd to show constraint comments Josh Kupershmidt <schmiddy@gmail.com>
Re: patch: Allow \dd to show constraint comments Robert Haas <robertmhaas@gmail.com>
Re: patch: Allow \dd to show constraint comments Josh Kupershmidt <schmiddy@gmail.com>
Re: patch: Allow \dd to show constraint comments Josh Kupershmidt <schmiddy@gmail.com>
Re: patch: Allow \dd to show constraint comments Alvaro Herrera <alvherre@commandprompt.com>
Re: patch: Allow \dd to show constraint comments Robert Haas <robertmhaas@gmail.com>
Re: patch: Allow \dd to show constraint comments Tom Lane <tgl@sss.pgh.pa.us>
Re: patch: Allow \dd to show constraint comments Robert Haas <robertmhaas@gmail.com>
Re: patch: Allow \dd to show constraint comments Kohei KaiGai <kaigai@kaigai.gr.jp>
Re: patch: Allow \dd to show constraint comments Josh Kupershmidt <schmiddy@gmail.com>
Re: patch: Allow \dd to show constraint comments Kohei KaiGai <kaigai@kaigai.gr.jp>
Re: patch: Allow \dd to show constraint comments Josh Kupershmidt <schmiddy@gmail.com>
Re: patch: Allow \dd to show constraint comments Josh Kupershmidt <schmiddy@gmail.com>
Re: patch: Allow \dd to show constraint comments Robert Haas <robertmhaas@gmail.com>
Re: patch: Allow \dd to show constraint comments Josh Kupershmidt <schmiddy@gmail.com>
Re: patch: Allow \dd to show constraint comments Robert Haas <robertmhaas@gmail.com>
Re: patch: Allow \dd to show constraint comments Josh Kupershmidt <schmiddy@gmail.com>
Re: patch: Allow \dd to show constraint comments Josh Kupershmidt <schmiddy@gmail.com>
Re: patch: Allow \dd to show constraint comments Josh Kupershmidt <schmiddy@gmail.com>
Re: patch: Allow \dd to show constraint comments Thom Brown <thom@linux.com>
Re: patch: Allow \dd to show constraint comments Josh Kupershmidt <schmiddy@gmail.com>
Re: patch: Allow \dd to show constraint comments Robert Haas <robertmhaas@gmail.com>
Re: patch: Allow \dd to show constraint comments Merlin Moncure <mmoncure@gmail.com>
Re: patch: Allow \dd to show constraint comments Robert Haas <robertmhaas@gmail.com>
Re: patch: Allow \dd to show constraint comments Merlin Moncure <mmoncure@gmail.com>
Re: patch: Allow \dd to show constraint comments Josh Kupershmidt <schmiddy@gmail.com>
Re: patch: Allow \dd to show constraint comments Josh Berkus <josh@agliodbs.com>
Re: patch: Allow \dd to show constraint comments Robert Haas <robertmhaas@gmail.com>
Re: patch: Allow \dd to show constraint comments Josh Kupershmidt <schmiddy@gmail.com>
On Tue, May 17, 2011 at 10:27 PM, Josh Kupershmidt  wrote:
> 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.

At the risk of opening a can of worms, if we're going to fix \dd,
shouldn't we fix it completely, and include comments on ALL the object
types that can have them?  IIRC it's missing a bunch, not just
constraints.

Another thought is that I wonder if it's really useful to have a
backslash commands that dumps out comments on many different object
types.  In some cases, e.g. \db+, we include the description for the
object in the output of the backslash command that lists objects just
of that type, which seems like a better design.  Of course we have no
backslash command for constraints anyway....

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

В списке pgsql-hackers по дате отправления
От: Robert Haas
Дата:
Сообщение: Re: DOMAINs and CASTs
От: Robert Haas
Дата:
FAQ