Skip to content

Commit

Permalink
Fix compatibility with PG16
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
df7cb authored and emelsimsek committed Aug 17, 2023
1 parent e665c3d commit 835bdca
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/hll.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ static void hll_aggregation_restriction_hook(PlannerInfo *root, UpperRelationKin
#endif

static void MaximizeCostOfHashAggregate(Path *path);
#if PG_VERSION_NUM < 160000
static Oid get_extension_schema(Oid ext_oid);
#endif
static Oid FunctionOid(const char *schemaName, const char *functionName, int argumentCount, bool missingOk);
static void InitializeHllAggregateOids(void);
static bool HllAggregateOid(Oid aggregateOid);
Expand Down Expand Up @@ -257,6 +259,8 @@ InitializeHllAggregateOids()
aggregateValuesInitialized = true;
}

/* PG16 ships its own get_extension_schema */
#if PG_VERSION_NUM < 160000
/*
* get_extension_schema - given an extension OID, fetch its extnamespace
* Returns InvalidOid if no such extension.
Expand Down Expand Up @@ -308,6 +312,7 @@ get_extension_schema(Oid ext_oid)

return result;
}
#endif

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

char *qualifiedFunctionName = quote_qualified_identifier(schemaName, functionName);
List *qualifiedFunctionNameList = stringToQualifiedNameList(qualifiedFunctionName);
List *qualifiedFunctionNameList = stringToQualifiedNameList(qualifiedFunctionName
#if PG_VERSION_NUM >= 160000
, NULL
#endif
);
List *argumentList = NIL;
const bool findVariadics = false;
const bool findDefaults = false;
Expand Down

0 comments on commit 835bdca

Please sign in to comment.