get_constraint_index() and conindid

2020-12-07 Thread Peter Eisentraut
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.

Re: get_constraint_index() and conindid

2020-12-08 Thread Matthias van de Meent
On Mon, 7 Dec 2020 at 11:09, Peter Eisentraut 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

Re: get_constraint_index() and conindid

2020-12-08 Thread Tom Lane
Matthias van de Meent writes: > On Mon, 7 Dec 2020 at 11:09, Peter Eisentraut > 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 no

Re: get_constraint_index() and conindid

2020-12-08 Thread Michael Paquier
On Tue, Dec 08, 2020 at 01:28:39PM -0500, Tom Lane wrote: > Matthias van de Meent writes: >> On Mon, 7 Dec 2020 at 11:09, Peter Eisentraut >> 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

Re: get_constraint_index() and conindid

2020-12-09 Thread Peter Eisentraut
On 2020-12-09 07:37, Michael Paquier wrote: 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