pgsql: Fix partitioned index attachment

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix partitioned index attachment
Date: 2019-04-25 15:39:07
Message-ID: E1hJgSp-0003WJ-L7@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix partitioned index attachment

When an existing index in a partition is attached to a new index on
its parent, we forgot to set the "relispartition" flag correctly, which
meant that it was not possible to find the index in various operations,
such as adding a foreign key constraint that references that partitioned
table. One of four places that was assigning the parent index was
forgetting to do that, so fix by shifting responsibility of updating the
flag to the routine that changes the parent.

Author: Amit Langote, Álvaro Herrera
Reported-by: Hubert "depesz" Lubaczewski
Discussion: https://postgr.es/m/CA+HiwqHMsRtRYRWYTWavKJ8x14AFsv7bmAV46mYwnfD3vy8goQ@mail.gmail.com

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/b1f570b57cccba9275649815be009a3947b48130

Modified Files
--------------
src/backend/commands/indexcmds.c | 24 ++++++++++++++++++++++++
src/backend/commands/tablecmds.c | 37 -------------------------------------
2 files changed, 24 insertions(+), 37 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Geoghegan 2019-04-25 19:50:55 pgsql: Sanitize line pointers within contrib/amcheck.
Previous Message Alvaro Herrera 2019-04-25 15:23:10 pgsql: Fix partitioned index attachment