From 8743ee29a66e8ec65db9a1b44fe545088f2b95f2 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Thu, 28 Jun 2018 18:57:05 -0400 Subject: [PATCH] Fix crash when ALTER TABLE recreates indexes on partitions The skip_build flag was not being passed correctly when recursing to indexes on partitions, leading to attempts to rebuild indexes when they were not yet ready to be rebuilt. Reported-by: Rajkumar Raghuwanshi Discussion: https://postgr.es/m/CAKcux6mxNCGsgATwf5CGMF8g4WSupCXicCVMeKUTuWbyxHOMsQ@mail.gmail.com --- src/backend/commands/indexcmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index 3b82876c90..576c85f732 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -1033,7 +1033,7 @@ DefineIndex(Oid relationId, indexRelationId, /* this is our child */ createdConstraintId, is_alter_table, check_rights, check_not_in_use, - false, quiet); + skip_build, quiet); } pfree(attmap); -- 2.11.0