Improve psql's \d display of foreign key constraints When used on a partition containing foreign keys coming from one of its ancestors, \d would (rather unhelpfully) print the details about the pg_constraint row in the partition. This becomes a bit frustrating when the user tries things like dropping the FK in the partition; instead, show the details for the foreign key on the table where it is defined.
Also, when a table is referenced by a foreign key on a partitioned table, we would show multiple "Referenced by" lines, one for each partition, which gets unwieldy pretty fast. Modify that so that it shows only one line for the ancestor partitioned table where the FK is defined. Discussion: https://postgr.es/m/[email protected] Reviewed-by: Tom Lane, Amit Langote, Peter Eisentraut Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/1af25ca0c2d9d110bd7bd5be2a14fb20cd93ee78 Modified Files -------------- src/bin/psql/describe.c | 156 ++++++++++++++++++++++-------- src/test/regress/expected/foreign_key.out | 38 +++++--- src/test/regress/sql/foreign_key.sql | 2 + 3 files changed, 145 insertions(+), 51 deletions(-)
