rel->rd_pdcxt = AllocSetContextCreate(CacheMemoryContext,
"partition descriptor",
ALLOCSET_DEFAULT_SIZES);
- MemoryContextCopySetIdentifier(rel->rd_pdcxt, RelationGetRelationName(rel));
+ MemoryContextCopyAndSetIdentifier(rel->rd_pdcxt, RelationGetRelationName(rel));
oldcxt = MemoryContextSwitchTo(rel->rd_pdcxt);
SysScanDesc sscan;
HeapTuple tuple;
- MemoryContextCopySetIdentifier(rscxt,
+ MemoryContextCopyAndSetIdentifier(rscxt,
RelationGetRelationName(relation));
rsdesc = MemoryContextAllocZero(rscxt, sizeof(RowSecurityDesc));
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.
"relation rules",
ALLOCSET_SMALL_SIZES);
relation->rd_rulescxt = rulescxt;
- MemoryContextCopySetIdentifier(rulescxt,
+ MemoryContextCopyAndSetIdentifier(rulescxt,
RelationGetRelationName(relation));
/*
partkeycxt = AllocSetContextCreate(CurTransactionContext,
"partition key",
ALLOCSET_SMALL_SIZES);
- MemoryContextCopySetIdentifier(partkeycxt,
+ MemoryContextCopyAndSetIdentifier(partkeycxt,
RelationGetRelationName(relation));
key = (PartitionKey) MemoryContextAllocZero(partkeycxt,
"index info",
ALLOCSET_SMALL_SIZES);
relation->rd_indexcxt = indexcxt;
- MemoryContextCopySetIdentifier(indexcxt,
+ MemoryContextCopyAndSetIdentifier(indexcxt,
RelationGetRelationName(relation));
/*
"index info",
ALLOCSET_SMALL_SIZES);
rel->rd_indexcxt = indexcxt;
- MemoryContextCopySetIdentifier(indexcxt,
+ MemoryContextCopyAndSetIdentifier(indexcxt,
RelationGetRelationName(rel));
/*
saveCtx = AllocSetContextCreate(CacheMemoryContext,
"TS dictionary",
ALLOCSET_SMALL_SIZES);
- MemoryContextCopySetIdentifier(saveCtx, NameStr(dict->dictname));
+ MemoryContextCopyAndSetIdentifier(saveCtx, NameStr(dict->dictname));
}
else
{
/* 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));
extern bool MemoryContextContains(MemoryContext context, void *pointer);
/* Handy macro for copying and assigning context ID ... but note double eval */
-#define MemoryContextCopySetIdentifier(cxt, id) \
+#define MemoryContextCopyAndSetIdentifier(cxt, id) \
MemoryContextSetIdentifier(cxt, MemoryContextStrdup(cxt, id))
/*