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