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

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Japin Li <japinli@hotmail.com>
Cc: Michael Paquier <michael@paquier.xyz>, holly.roberts@starlingbank.com, peter@eisentraut.org, pgsql-bugs@lists.postgresql.org
Date: 2022-03-11T18:29:05Z
Lists: pgsql-bugs

Attachments

I wrote:
> (I've not figured out yet why the "cluster" step is required to
> make this repro work.)

Oh, of course: 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.

The attached seems to do the trick.

			regards, tom lane

Commits

  1. Restore the previous semantics of get_constraint_index().

  2. Change get_constraint_index() to use pg_constraint.conindid