pgsql: Fix partitioned index attachment

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

pgsql: Fix partitioned index attachment

Álvaro Herrera
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



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