summaryrefslogtreecommitdiff
path: root/src/backend/utils/cache
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2023-07-31 17:04:47 -0700
committerNoah Misch <noah@leadboat.com>2023-07-31 17:04:47 -0700
commitd3a38318ac614f20a9e2e163bba083d15be54f06 (patch)
tree58f314185705c1dde7b91101a5f40789dde69433 /src/backend/utils/cache
parent7c5c4e1c0396b0617a6f9b659dd7375fb0bfb9dc (diff)
Rename OverrideSearchPath to SearchPathMatcher.
The previous commit removed the "override" APIs. Surviving APIs facilitate plancache.c to snapshot search_path and test whether the current value equals a remembered snapshot. Aleksander Alekseev. Reported by Alexander Lakhin and Noah Misch. Discussion: https://postgr.es/m/8ffb4650-52c4-6a81-38fc-8f99be981130@gmail.com
Diffstat (limited to 'src/backend/utils/cache')
-rw-r--r--src/backend/utils/cache/plancache.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/backend/utils/cache/plancache.c b/src/backend/utils/cache/plancache.c
index 56c84e1e629..d67cd9a4053 100644
--- a/src/backend/utils/cache/plancache.c
+++ b/src/backend/utils/cache/plancache.c
@@ -407,7 +407,7 @@ CompleteCachedPlan(CachedPlanSource *plansource,
* one-shot plans; and we *must* skip this for transaction control
* commands, because this could result in catalog accesses.
*/
- plansource->search_path = GetOverrideSearchPath(querytree_context);
+ plansource->search_path = GetSearchPathMatcher(querytree_context);
}
/*
@@ -586,7 +586,7 @@ RevalidateCachedQuery(CachedPlanSource *plansource,
if (plansource->is_valid)
{
Assert(plansource->search_path != NULL);
- if (!OverrideSearchPathMatchesCurrent(plansource->search_path))
+ if (!SearchPathMatchesCurrentEnvironment(plansource->search_path))
{
/* Invalidate the querytree and generic plan */
plansource->is_valid = false;
@@ -759,7 +759,7 @@ RevalidateCachedQuery(CachedPlanSource *plansource,
* not generate much extra cruft either, since almost certainly the path
* is already valid.)
*/
- plansource->search_path = GetOverrideSearchPath(querytree_context);
+ plansource->search_path = GetSearchPathMatcher(querytree_context);
MemoryContextSwitchTo(oldcxt);
@@ -1326,7 +1326,7 @@ CachedPlanAllowsSimpleValidityCheck(CachedPlanSource *plansource,
Assert(plan->is_valid);
Assert(plan == plansource->gplan);
Assert(plansource->search_path != NULL);
- Assert(OverrideSearchPathMatchesCurrent(plansource->search_path));
+ Assert(SearchPathMatchesCurrentEnvironment(plansource->search_path));
/* We don't support oneshot plans here. */
if (plansource->is_oneshot)
@@ -1449,7 +1449,7 @@ CachedPlanIsSimplyValid(CachedPlanSource *plansource, CachedPlan *plan,
/* Is the search_path still the same as when we made it? */
Assert(plansource->search_path != NULL);
- if (!OverrideSearchPathMatchesCurrent(plansource->search_path))
+ if (!SearchPathMatchesCurrentEnvironment(plansource->search_path))
return false;
/* It's still good. Bump refcount if requested. */
@@ -1565,7 +1565,7 @@ CopyCachedPlan(CachedPlanSource *plansource)
newsource->relationOids = copyObject(plansource->relationOids);
newsource->invalItems = copyObject(plansource->invalItems);
if (plansource->search_path)
- newsource->search_path = CopyOverrideSearchPath(plansource->search_path);
+ newsource->search_path = CopySearchPathMatcher(plansource->search_path);
newsource->query_context = querytree_context;
newsource->rewriteRoleId = plansource->rewriteRoleId;
newsource->rewriteRowSecurity = plansource->rewriteRowSecurity;