Skip to content

Commit 835bdca

Browse files
df7cbemelsimsek
authored andcommitted
Fix compatibility with PG16
PG16 ships its own get_extension_schema function, use that. stringToQualifiedNameList grew and extra argument for error reporting that can be set to NULL. Close #146.
1 parent e665c3d commit 835bdca

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/hll.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ static void hll_aggregation_restriction_hook(PlannerInfo *root, UpperRelationKin
142142
#endif
143143

144144
static void MaximizeCostOfHashAggregate(Path *path);
145+
#if PG_VERSION_NUM < 160000
145146
static Oid get_extension_schema(Oid ext_oid);
147+
#endif
146148
static Oid FunctionOid(const char *schemaName, const char *functionName, int argumentCount, bool missingOk);
147149
static void InitializeHllAggregateOids(void);
148150
static bool HllAggregateOid(Oid aggregateOid);
@@ -257,6 +259,8 @@ InitializeHllAggregateOids()
257259
aggregateValuesInitialized = true;
258260
}
259261

262+
/* PG16 ships its own get_extension_schema */
263+
#if PG_VERSION_NUM < 160000
260264
/*
261265
* get_extension_schema - given an extension OID, fetch its extnamespace
262266
* Returns InvalidOid if no such extension.
@@ -308,6 +312,7 @@ get_extension_schema(Oid ext_oid)
308312

309313
return result;
310314
}
315+
#endif
311316

312317
/*
313318
* FunctionOid searches for a given function identified by schema, functionName
@@ -323,7 +328,11 @@ FunctionOid(const char *schemaName, const char *functionName, int argumentCount,
323328
Oid functionOid = InvalidOid;
324329

325330
char *qualifiedFunctionName = quote_qualified_identifier(schemaName, functionName);
326-
List *qualifiedFunctionNameList = stringToQualifiedNameList(qualifiedFunctionName);
331+
List *qualifiedFunctionNameList = stringToQualifiedNameList(qualifiedFunctionName
332+
#if PG_VERSION_NUM >= 160000
333+
, NULL
334+
#endif
335+
);
327336
List *argumentList = NIL;
328337
const bool findVariadics = false;
329338
const bool findDefaults = false;

0 commit comments

Comments
 (0)