From 7c276460e4a4052e454b9c44148346e7286eb280 Mon Sep 17 00:00:00 2001 From: Teodor Sigaev Date: Mon, 22 Jul 2019 14:54:29 +0300 Subject: [PATCH] fix deleting cell on fly --- plantuner.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plantuner.c b/plantuner.c index 1973d01..b22ef9c 100644 --- a/plantuner.c +++ b/plantuner.c @@ -326,6 +326,7 @@ indexFilter(PlannerInfo *root, Oid relationObjectId, bool inhparent, { ListCell *l; +restart1: foreach(l, rel->indexlist) { IndexOptInfo *info = (IndexOptInfo*)lfirst(l); @@ -336,7 +337,10 @@ indexFilter(PlannerInfo *root, Oid relationObjectId, bool inhparent, remove = false; if (remove) + { rel->indexlist = list_delete_ptr(rel->indexlist, info); + goto restart1; + } } return; -- 2.46.1