aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/cache
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/cache')
-rw-r--r--src/backend/utils/cache/plancache.c2
-rw-r--r--src/backend/utils/cache/relcache.c8
-rw-r--r--src/backend/utils/cache/ts_cache.c4
3 files changed, 7 insertions, 7 deletions
diff --git a/src/backend/utils/cache/plancache.c b/src/backend/utils/cache/plancache.c
index 85bb7b914a0..0ad3e3c7366 100644
--- a/src/backend/utils/cache/plancache.c
+++ b/src/backend/utils/cache/plancache.c
@@ -952,7 +952,7 @@ BuildCachedPlan(CachedPlanSource *plansource, List *qlist,
plan_context = AllocSetContextCreate(CurrentMemoryContext,
"CachedPlan",
ALLOCSET_START_SMALL_SIZES);
- MemoryContextCopySetIdentifier(plan_context, plansource->query_string);
+ MemoryContextCopyAndSetIdentifier(plan_context, plansource->query_string);
/*
* Copy plan into the new context.
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index 69a2114a104..b6ed06d5b3c 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -741,7 +741,7 @@ RelationBuildRuleLock(Relation relation)
"relation rules",
ALLOCSET_SMALL_SIZES);
relation->rd_rulescxt = rulescxt;
- MemoryContextCopySetIdentifier(rulescxt,
+ MemoryContextCopyAndSetIdentifier(rulescxt,
RelationGetRelationName(relation));
/*
@@ -918,7 +918,7 @@ RelationBuildPartitionKey(Relation relation)
partkeycxt = AllocSetContextCreate(CurTransactionContext,
"partition key",
ALLOCSET_SMALL_SIZES);
- MemoryContextCopySetIdentifier(partkeycxt,
+ MemoryContextCopyAndSetIdentifier(partkeycxt,
RelationGetRelationName(relation));
key = (PartitionKey) MemoryContextAllocZero(partkeycxt,
@@ -1601,7 +1601,7 @@ RelationInitIndexAccessInfo(Relation relation)
"index info",
ALLOCSET_SMALL_SIZES);
relation->rd_indexcxt = indexcxt;
- MemoryContextCopySetIdentifier(indexcxt,
+ MemoryContextCopyAndSetIdentifier(indexcxt,
RelationGetRelationName(relation));
/*
@@ -5668,7 +5668,7 @@ load_relcache_init_file(bool shared)
"index info",
ALLOCSET_SMALL_SIZES);
rel->rd_indexcxt = indexcxt;
- MemoryContextCopySetIdentifier(indexcxt,
+ MemoryContextCopyAndSetIdentifier(indexcxt,
RelationGetRelationName(rel));
/*
diff --git a/src/backend/utils/cache/ts_cache.c b/src/backend/utils/cache/ts_cache.c
index 97347780d3b..f11cba4cced 100644
--- a/src/backend/utils/cache/ts_cache.c
+++ b/src/backend/utils/cache/ts_cache.c
@@ -297,7 +297,7 @@ lookup_ts_dictionary_cache(Oid dictId)
saveCtx = AllocSetContextCreate(CacheMemoryContext,
"TS dictionary",
ALLOCSET_SMALL_SIZES);
- MemoryContextCopySetIdentifier(saveCtx, NameStr(dict->dictname));
+ MemoryContextCopyAndSetIdentifier(saveCtx, NameStr(dict->dictname));
}
else
{
@@ -306,7 +306,7 @@ lookup_ts_dictionary_cache(Oid dictId)
/* Don't let context's ident pointer dangle while we reset it */
MemoryContextSetIdentifier(saveCtx, NULL);
MemoryContextReset(saveCtx);
- MemoryContextCopySetIdentifier(saveCtx, NameStr(dict->dictname));
+ MemoryContextCopyAndSetIdentifier(saveCtx, NameStr(dict->dictname));
}
MemSet(entry, 0, sizeof(TSDictionaryCacheEntry));