mirror of
https://github.com/postgres/postgres.git
synced 2025-04-25 21:42:33 +03:00
rename macro isTempOrToastNamespace to isTempOrTempToastNamespace
Done for clarity
This commit is contained in:
parent
5d16332e96
commit
73fe87503f
@ -629,7 +629,7 @@ RangeVarAdjustRelationPersistence(RangeVar *newRelation, Oid nspid)
|
||||
switch (newRelation->relpersistence)
|
||||
{
|
||||
case RELPERSISTENCE_TEMP:
|
||||
if (!isTempOrToastNamespace(nspid))
|
||||
if (!isTempOrTempToastNamespace(nspid))
|
||||
{
|
||||
if (isAnyTempNamespace(nspid))
|
||||
ereport(ERROR,
|
||||
@ -642,7 +642,7 @@ RangeVarAdjustRelationPersistence(RangeVar *newRelation, Oid nspid)
|
||||
}
|
||||
break;
|
||||
case RELPERSISTENCE_PERMANENT:
|
||||
if (isTempOrToastNamespace(nspid))
|
||||
if (isTempOrTempToastNamespace(nspid))
|
||||
newRelation->relpersistence = RELPERSISTENCE_TEMP;
|
||||
else if (isAnyTempNamespace(nspid))
|
||||
ereport(ERROR,
|
||||
@ -2992,11 +2992,11 @@ isTempToastNamespace(Oid namespaceId)
|
||||
}
|
||||
|
||||
/*
|
||||
* isTempOrToastNamespace - is the given namespace my temporary-table
|
||||
* isTempOrTempToastNamespace - is the given namespace my temporary-table
|
||||
* namespace or my temporary-toast-table namespace?
|
||||
*/
|
||||
bool
|
||||
isTempOrToastNamespace(Oid namespaceId)
|
||||
isTempOrTempToastNamespace(Oid namespaceId)
|
||||
{
|
||||
if (OidIsValid(myTempNamespace) &&
|
||||
(myTempNamespace == namespaceId || myTempToastNamespace == namespaceId))
|
||||
@ -3036,7 +3036,7 @@ bool
|
||||
isOtherTempNamespace(Oid namespaceId)
|
||||
{
|
||||
/* If it's my own temp namespace, say "false" */
|
||||
if (isTempOrToastNamespace(namespaceId))
|
||||
if (isTempOrTempToastNamespace(namespaceId))
|
||||
return false;
|
||||
/* Else, if it's any temp namespace, say "true" */
|
||||
return isAnyTempNamespace(namespaceId);
|
||||
|
@ -254,7 +254,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
|
||||
* Toast tables for regular relations go in pg_toast; those for temp
|
||||
* relations go into the per-backend temp-toast-table namespace.
|
||||
*/
|
||||
if (isTempOrToastNamespace(rel->rd_rel->relnamespace))
|
||||
if (isTempOrTempToastNamespace(rel->rd_rel->relnamespace))
|
||||
namespaceid = GetTempToastNamespace();
|
||||
else
|
||||
namespaceid = PG_TOAST_NAMESPACE;
|
||||
|
@ -836,7 +836,7 @@ pg_relation_filepath(PG_FUNCTION_ARGS)
|
||||
backend = InvalidBackendId;
|
||||
break;
|
||||
case RELPERSISTENCE_TEMP:
|
||||
if (isTempOrToastNamespace(relform->relnamespace))
|
||||
if (isTempOrTempToastNamespace(relform->relnamespace))
|
||||
backend = MyBackendId;
|
||||
else
|
||||
{
|
||||
|
4
src/backend/utils/cache/relcache.c
vendored
4
src/backend/utils/cache/relcache.c
vendored
@ -913,7 +913,7 @@ RelationBuildDesc(Oid targetRelId, bool insertIt)
|
||||
relation->rd_islocaltemp = false;
|
||||
break;
|
||||
case RELPERSISTENCE_TEMP:
|
||||
if (isTempOrToastNamespace(relation->rd_rel->relnamespace))
|
||||
if (isTempOrTempToastNamespace(relation->rd_rel->relnamespace))
|
||||
{
|
||||
relation->rd_backend = MyBackendId;
|
||||
relation->rd_islocaltemp = true;
|
||||
@ -2811,7 +2811,7 @@ RelationBuildLocalRelation(const char *relname,
|
||||
rel->rd_islocaltemp = false;
|
||||
break;
|
||||
case RELPERSISTENCE_TEMP:
|
||||
Assert(isTempOrToastNamespace(relnamespace));
|
||||
Assert(isTempOrTempToastNamespace(relnamespace));
|
||||
rel->rd_backend = MyBackendId;
|
||||
rel->rd_islocaltemp = true;
|
||||
break;
|
||||
|
@ -121,7 +121,7 @@ extern char *NameListToQuotedString(List *names);
|
||||
|
||||
extern bool isTempNamespace(Oid namespaceId);
|
||||
extern bool isTempToastNamespace(Oid namespaceId);
|
||||
extern bool isTempOrToastNamespace(Oid namespaceId);
|
||||
extern bool isTempOrTempToastNamespace(Oid namespaceId);
|
||||
extern bool isAnyTempNamespace(Oid namespaceId);
|
||||
extern bool isOtherTempNamespace(Oid namespaceId);
|
||||
extern int GetTempNamespaceBackendId(Oid namespaceId);
|
||||
|
Loading…
x
Reference in New Issue
Block a user