Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compile with PG17 #76

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions matview.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,14 @@ typedef struct MV_QueryHashEntry
{
MV_QueryKey key;
SPIPlanPtr plan;

#if PG_VERSION_NUM < 170000
OverrideSearchPath *search_path; /* search_path used for parsing
* and planning */
#else
SearchPathMatcher *search_path; /* search_path used for parsing
* and planning */
#endif

} MV_QueryHashEntry;

Expand Down Expand Up @@ -3055,7 +3061,11 @@ mv_FetchPreparedPlan(MV_QueryKey *key)
*/
plan = entry->plan;
if (plan && SPI_plan_is_valid(plan) &&
#if PG_VERSION_NUM < 170000
OverrideSearchPathMatchesCurrent(entry->search_path))
#else
SearchPathMatchesCurrentEnvironment(entry->search_path))
#endif
return plan;

/*
Expand Down Expand Up @@ -3099,7 +3109,11 @@ mv_HashPreparedPlan(MV_QueryKey *key, SPIPlanPtr plan)
HASH_ENTER, &found);
Assert(!found || entry->plan == NULL);
entry->plan = plan;
#if PG_VERSION_NUM < 170000
entry->search_path = GetOverrideSearchPath(TopMemoryContext);
#else
entry->search_path = GetSearchPathMatcher(TopMemoryContext);
#endif
}

/*
Expand Down