Fix compile with PG17 (#76)
Support for PostgreSQL17 Rename OverrideSearchPath to SearchPathMatcher from PG17.
This commit is contained in:
parent
9736c8c832
commit
76888cd975
1 changed files with 14 additions and 0 deletions
14
matview.c
14
matview.c
|
|
@ -80,8 +80,14 @@ typedef struct MV_QueryHashEntry
|
||||||
{
|
{
|
||||||
MV_QueryKey key;
|
MV_QueryKey key;
|
||||||
SPIPlanPtr plan;
|
SPIPlanPtr plan;
|
||||||
|
|
||||||
|
#if PG_VERSION_NUM < 170000
|
||||||
OverrideSearchPath *search_path; /* search_path used for parsing
|
OverrideSearchPath *search_path; /* search_path used for parsing
|
||||||
* and planning */
|
* and planning */
|
||||||
|
#else
|
||||||
|
SearchPathMatcher *search_path; /* search_path used for parsing
|
||||||
|
* and planning */
|
||||||
|
#endif
|
||||||
|
|
||||||
} MV_QueryHashEntry;
|
} MV_QueryHashEntry;
|
||||||
|
|
||||||
|
|
@ -3066,7 +3072,11 @@ mv_FetchPreparedPlan(MV_QueryKey *key)
|
||||||
*/
|
*/
|
||||||
plan = entry->plan;
|
plan = entry->plan;
|
||||||
if (plan && SPI_plan_is_valid(plan) &&
|
if (plan && SPI_plan_is_valid(plan) &&
|
||||||
|
#if PG_VERSION_NUM < 170000
|
||||||
OverrideSearchPathMatchesCurrent(entry->search_path))
|
OverrideSearchPathMatchesCurrent(entry->search_path))
|
||||||
|
#else
|
||||||
|
SearchPathMatchesCurrentEnvironment(entry->search_path))
|
||||||
|
#endif
|
||||||
return plan;
|
return plan;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -3110,7 +3120,11 @@ mv_HashPreparedPlan(MV_QueryKey *key, SPIPlanPtr plan)
|
||||||
HASH_ENTER, &found);
|
HASH_ENTER, &found);
|
||||||
Assert(!found || entry->plan == NULL);
|
Assert(!found || entry->plan == NULL);
|
||||||
entry->plan = plan;
|
entry->plan = plan;
|
||||||
|
#if PG_VERSION_NUM < 170000
|
||||||
entry->search_path = GetOverrideSearchPath(TopMemoryContext);
|
entry->search_path = GetOverrideSearchPath(TopMemoryContext);
|
||||||
|
#else
|
||||||
|
entry->search_path = GetSearchPathMatcher(TopMemoryContext);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue