v16 support. Dmitry Koval
authorTeodor Sigaev <teodor@sigaev.ru>
Wed, 18 Jan 2023 13:10:43 +0000 (16:10 +0300)
committerTeodor Sigaev <teodor@sigaev.ru>
Wed, 18 Jan 2023 13:10:43 +0000 (16:10 +0300)
plantuner.c

index f87dcea..0c07b7f 100644 (file)
@@ -35,6 +35,9 @@
 #include <access/xact.h>
 #include <catalog/namespace.h>
 #include <catalog/pg_class.h>
+#if PG_VERSION_NUM >= 160000
+#include <nodes/miscnodes.h>
+#endif
 #include <nodes/pg_list.h>
 #include <optimizer/plancat.h>
 #include <storage/bufmgr.h>
@@ -149,9 +152,23 @@ indexesAssign(const char * newval, bool doit, GucSource source,
        {
                char    *curname = (char *) lfirst(l);
 #if PG_VERSION_NUM >= 90200
-               Oid             indexOid = RangeVarGetRelid(
-                               makeRangeVarFromNameList(stringToQualifiedNameList(curname)),
-                                                                                       NoLock, true);
+               List    *cur_namelist;
+               Oid             indexOid;
+
+#if PG_VERSION_NUM >= 160000
+               ErrorSaveContext escontext = {T_ErrorSaveContext};
+
+               cur_namelist = stringToQualifiedNameList(curname, (Node *) &escontext);
+
+               /* bad name list syntax */
+               if (cur_namelist == NIL)
+                       continue;
+#else
+               cur_namelist = stringToQualifiedNameList(curname);
+#endif
+
+               indexOid = RangeVarGetRelid(makeRangeVarFromNameList(cur_namelist),
+                                                                       NoLock, true);
 #else
                Oid             indexOid = RangeVarGetRelid(
                                makeRangeVarFromNameList(stringToQualifiedNameList(curname)),