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

From Tom Lane
Subject Re: psql display of foreign keys
Date
Msg-id 23923.1543935600@sss.pgh.pa.us
Whole thread Raw
In response to psql display of foreign keys  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: psql display of foreign keys  (David Fetter <david@fetter.org>)
Re: psql display of foreign keys  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> This is not very useful.  I propose that we change it so that it only
> displays the one on the partitioned table on which the constraint was
> defined:

OK goal, but ...

> Patch attached.

... this patch breaks the expectation set at the top of describe.c:

 * Support for the various \d ("describe") commands.  Note that the current
 * expectation is that all functions in this file will succeed when working
 * with servers of versions 7.4 and up.  It's okay to omit irrelevant
 * information for an old server, but not to fail outright.

Do you really need WITH RECURSIVE for this?  If so, I'd suggest
applying it only when relkind == RELKIND_PARTITIONED_TABLE, so
that the case doesn't happen in servers too old to have WITH.
That's probably a win performance-wise anyway, as I have no doubt
that the performance of this query is awful compared to what it
replaces, so we don't really want to use it if we don't have to.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: psql display of foreign keys
Next
From: David Fetter
Date:
Subject: Re: psql display of foreign keys