X-Git-Url: http://sigaev.ru/git/gitweb.cgi?p=plantuner.git;a=blobdiff_plain;f=plantuner.c;h=f87dcea21ffe4202225b5a9a3241d28880e661d1;hp=1973d0176a36ee29260c0521e8968bb50bc12a8a;hb=800d81bc85da64ff3ef66e12aed1d4e1e54fc006;hpb=ecc61f2bf65d40d144e394dc228e9f93d865776e diff --git a/plantuner.c b/plantuner.c index 1973d01..f87dcea 100644 --- a/plantuner.c +++ b/plantuner.c @@ -49,6 +49,11 @@ PG_MODULE_MAGIC; +#if PG_VERSION_NUM >= 130000 +#define heap_open(r, l) table_open(r, l) +#define heap_close(r, l) table_close(r, l) +#endif + static int nDisabledIndexes = 0; static Oid *disabledIndexes = NULL; static char *disableIndexesOutStr = ""; @@ -326,6 +331,7 @@ indexFilter(PlannerInfo *root, Oid relationObjectId, bool inhparent, { ListCell *l; +restart1: foreach(l, rel->indexlist) { IndexOptInfo *info = (IndexOptInfo*)lfirst(l); @@ -336,7 +342,10 @@ indexFilter(PlannerInfo *root, Oid relationObjectId, bool inhparent, remove = false; if (remove) + { rel->indexlist = list_delete_ptr(rel->indexlist, info); + goto restart1; + } } return;