Re: get_constraint_index() and conindid

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: get_constraint_index() and conindid
Date: 2020-12-09 06:37:50
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Dec 08, 2020 at 01:28:39PM -0500, Tom Lane wrote:
> Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com> writes:
>> On Mon, 7 Dec 2020 at 11:09, Peter Eisentraut
>> <peter(dot)eisentraut(at)enterprisedb(dot)com> wrote:
>>> get_constraint_index() does its work by going through pg_depend. It was
>>> added before pg_constraint.conindid was added, and some callers are
>>> still not changed. Are there reasons for that? Probably not. The
>>> attached patch changes get_constraint_index() to an lsyscache-style
>>> lookup instead.
>> This looks quite reasonable, and it passes "make installcheck-world".
> +1, LGTM.

Nice cleanup!

>> Only thing I could think of is that it maybe could use a (small)
>> comment in the message on that/why get_constraint_index is moved to
>> utils/lsyscache from catalog/dependency, as that took me some time to
>> understand.
> commit message could reasonably say that maybe, but I don't think we
> need to memorialize it in a comment. lsyscache.c *is* where one
> would expect to find a simple catalog-field-fetch function like this.
> The previous implementation was not that, so it didn't belong there.


In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey Borodin 2020-12-09 07:44:42 pglz compression performance, take two
Previous Message 曾文旌 2020-12-09 06:33:59 Re: [Proposal] Global temporary tables