Re: psql display of foreign keys - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: psql display of foreign keys
Date
Msg-id 5a177045-771d-781a-7c33-105f39dcdab6@2ndquadrant.com
Whole thread Raw
In response to Re: psql display of foreign keys  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: psql display of foreign keys
List pgsql-hackers
On 2019-03-23 03:30, Alvaro Herrera wrote:
>>> Thanks for the updated patch.  I applied it and rebased the
>>> foreign-keys-referencing-partitioned-tables patch on top.  Here's
>>> something I think you may have missed:
>>
>> I missed that indeed!  Thanks for noticing.  Here's an updated and
>> rebased version of this patch.
> 
> I forgot to "git add" the new changes to the expected file.  Here's v8
> with that fixed.

Looks OK in general.

relispartition was added in PG10, so the conditional in
describeOneTableDetails() seems wrong.

In the older branches of that same function, I'd prefer writing

    false AS relispartition

for clarity.

Some of the other queries could also use some column aliases, like

    conrelid = '%s'::pg_catalog.regclass AS isroot (?)

or

    pg_catalog.pg_get_constraintdef(oid, true) AS condef

(as in the other branch).

A test case for the incoming foreign key display would be nice, as that
was the original argument for the patch.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Usage of epoch in txid_current
Next
From: Panagiotis Mavrogiorgos
Date:
Subject: Feature: Add Greek language fulltext search