Re: BUG #17409: Unable to alter data type of clustered column which is referenced by foreign key

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Japin Li <japinli@hotmail.com>, holly.roberts@starlingbank.com, peter@eisentraut.org, pgsql-bugs@lists.postgresql.org
Date: 2022-03-14T07:51:10Z
Lists: pgsql-bugs
On Fri, Mar 11, 2022 at 01:29:05PM -0500, Tom Lane wrote:
> Oh, of course:

Thanks for dropping by the thread.  I was planning to bisect that 
but with the CF things have gone out of hand.

> the failure only occurs if we think the index is clustered
> or a replica-identity index; else we don't store a request to rebuild it.

Yes, I think that what you did in 369398e to tweak
get_constraint_name() is the right fix, or we'd finish by creating
more index rebuild requests than necessary when going through the
inheritance tree of these tables.
--
Michael

Commits

  1. Restore the previous semantics of get_constraint_index().

  2. Change get_constraint_index() to use pg_constraint.conindid