get_constraint_index() and conindid

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: get_constraint_index() and conindid
Date: 2020-12-07 10:09:16
Message-ID: 4688d55c-9a2e-9a5a-d166-5f24fe0bf8db@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

The nearby get_index_constraint() should probably also be changed to
scan pg_constraint instead of pg_depend, but that doesn't have a
syscache to use, so it would be a different approach, so I figured I'd
ask about get_constraint_index() first.

Attachment Content-Type Size
0001-Change-get_constraint_index-to-use-pg_constraint.con.patch text/plain 6.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2020-12-07 10:12:20 Re: RFC: Deadlock detector hooks for victim selection and edge injection
Previous Message Andrey Borodin 2020-12-07 10:05:19 Re: Yet another fast GiST build