Re: Add psql command to list constraints - Mailing list pgsql-hackers

From Tatsuro Yamada
Subject Re: Add psql command to list constraints
Date
Msg-id dd4d56ab-7062-bb76-4e4a-31992d20fffa@nttcom.co.jp
Whole thread Raw
In response to Re: Add psql command to list constraints  (Tatsuro Yamada <tatsuro.yamada.tf@nttcom.co.jp>)
List pgsql-hackers
Hi Dag,

> The patch adds the command "\dco" to list constraints in psql. This
> seems useful to me.

Thank you!

  
> The patch applies cleanly to HEAD, although some hunks have rather large
> offsets.
>
> As far as I can tell, the "\dco" command works as documented.
>
> I have however found the following issues with the patch:
>
> * A TAB character has been added to doc/src/sgml/ref/psql-ref.sgml -
>    this should be replaced with spaces.

Fixed.


> * The call to listConstraints in line src/bin/psql/command.c 794 refers
>    to &cmd[2], this should rather be &cmd[3].
>
> * The patch kills the "\dc" command in src/bin/psql/command.c
>    This can be fixed by adding the following at line 800:
>                else
>                                          success =
>    listConversions(pattern, show_verbose, show_system);


Oh, you are right! Fixed.

  
> Another comment is that the "\dco" command outputs quite a lot of
> information, which only fits in a wide terminal window. Would it be an
> idea to only display the columns "Schema" and "Name" by default, and
> use "+" to specify inclusion of the columns "Definition" and "Table".
  

I fixed the output columns as you proposed.

The current status of this patch is:

   - Addressed Dag's comments
   - Not implemented yet:
     - Tab completion
     - Regression test
     - NOT NULL constraint, and so on (based on pg_attribute)

Please find attached new patch.


Thanks,
Tatsuro Yamada





Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Skipping logical replication transactions on subscriber side
Next
From: Amit Kapila
Date:
Subject: Re: Identify missing publications from publisher while create/alter subscription.