Re: psql display of foreign keys

From: David Fetter <david(at)fetter(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: psql display of foreign keys
Date: 2018-12-04 15:23:30
Message-ID: 20181204152330.GH20931@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Dec 04, 2018 at 10:00:00AM -0500, Tom Lane wrote:
> Alvaro Herrera <alvherre(at)2ndquadrant(dot)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.

Makes sense.

> 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.

Do you have cases where we should be measuring performance dips?
Also, is there something about about indexes involved in this query
or WITH RECURSIVE itself that's pessimizing performance, generally?

Best,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2018-12-04 15:46:18 Re: psql display of foreign keys
Previous Message Tom Lane 2018-12-04 15:00:00 Re: psql display of foreign keys