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

Japin Li <japinli@hotmail.com>

From: Japin Li <japinli@hotmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Michael Paquier <michael@paquier.xyz>, holly.roberts@starlingbank.com, peter@eisentraut.org, pgsql-bugs@lists.postgresql.org
Date: 2022-03-12T00:31:21Z
Lists: pgsql-bugs
On Sat, 12 Mar 2022 at 02:29, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 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.
>

Fantastic!  Thanks for your detail dig.

--
Regrads,
Japin Li.
ChengDu WenWu Information Technology Co.,Ltd.



Commits

  1. Restore the previous semantics of get_constraint_index().

  2. Change get_constraint_index() to use pg_constraint.conindid