]> granicus.if.org Git - postgresql/commit
Improve psql's \d command to show whether index columns are key columns.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 19 Jul 2018 18:53:41 +0000 (14:53 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 19 Jul 2018 18:53:50 +0000 (14:53 -0400)
commitf4a5ce359587257c6d14b8e746889077c649439a
treeacd7ebd1e19ac7f56dcf83ae478a2a3d05a4152c
parent0f49a2de96e7b58e15899b2639e096b771e45886
Improve psql's \d command to show whether index columns are key columns.

This is essential information when looking at an index that has
"included" columns.  Per discussion, follow the style used in \dC
and some other places: column header is "Key?" and values are "yes"
or "no" (all translatable).

While at it, revise describeOneTableDetails to be a bit more maintainable:
avoid hard-wired column numbers and multiple repetitions of what needs
to be identical test logic.  This also results in the emitted catalog
query corresponding more closely to what we print, which should be a
benefit to users of ECHO_HIDDEN mode, and perhaps a bit faster too
(the old logic sometimes asked for values it would not print, even
ones that are fairly expensive to get).

Discussion: https://postgr.es/m/21724.1531943735@sss.pgh.pa.us
src/bin/psql/describe.c
src/test/regress/expected/alter_table.out
src/test/regress/expected/create_index.out
src/test/regress/expected/index_including.out
src/test/regress/output/tablespace.source