From 0652f9e858cacb087201f7ab658101bcba7a31a9 Mon Sep 17 00:00:00 2001 From: Teodor Sigaev Date: Wed, 18 Jan 2023 16:10:43 +0300 Subject: [PATCH] v16 support. Dmitry Koval --- plantuner.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/plantuner.c b/plantuner.c index f87dcea..0c07b7f 100644 --- a/plantuner.c +++ b/plantuner.c @@ -35,6 +35,9 @@ #include #include #include +#if PG_VERSION_NUM >= 160000 +#include +#endif #include #include #include @@ -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)), -- 2.46.1