- 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);