Skip to content

Commit 524366f

Browse files
committed
fix handling of implicit temp tables (pg_temp schema)
1 parent 8f73f80 commit 524366f

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

multimaster.c

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,18 +1139,19 @@ void MtmHandleApplyError(void)
11391139
{
11401140
ErrorData *edata = CopyErrorData();
11411141
switch (edata->sqlerrcode) {
1142-
case ERRCODE_DISK_FULL:
1143-
case ERRCODE_INSUFFICIENT_RESOURCES:
1144-
case ERRCODE_IO_ERROR:
1145-
case ERRCODE_DATA_CORRUPTED:
1146-
case ERRCODE_INDEX_CORRUPTED:
1147-
case ERRCODE_SYSTEM_ERROR:
1148-
case ERRCODE_INTERNAL_ERROR:
1149-
case ERRCODE_OUT_OF_MEMORY:
1150-
elog(WARNING, "Node is excluded from cluster because of non-recoverable error %d", edata->sqlerrcode);
1151-
MtmSwitchClusterMode(MTM_OUT_OF_SERVICE);
1152-
kill(PostmasterPid, SIGQUIT);
1153-
break;
1142+
case ERRCODE_DISK_FULL:
1143+
case ERRCODE_INSUFFICIENT_RESOURCES:
1144+
case ERRCODE_IO_ERROR:
1145+
case ERRCODE_DATA_CORRUPTED:
1146+
case ERRCODE_INDEX_CORRUPTED:
1147+
case ERRCODE_SYSTEM_ERROR:
1148+
case ERRCODE_INTERNAL_ERROR:
1149+
case ERRCODE_OUT_OF_MEMORY:
1150+
elog(WARNING, "Node is excluded from cluster because of non-recoverable error %d, %s, pid=%u",
1151+
edata->sqlerrcode, edata->message, getpid());
1152+
MtmSwitchClusterMode(MTM_OUT_OF_SERVICE);
1153+
kill(PostmasterPid, SIGQUIT);
1154+
break;
11541155
}
11551156
FreeErrorData(edata);
11561157
}
@@ -3158,7 +3159,8 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
31583159
{
31593160
/* Do not replicate temp tables */
31603161
CreateStmt *stmt = (CreateStmt *) parsetree;
3161-
skipCommand = stmt->relation->relpersistence == RELPERSISTENCE_TEMP;
3162+
skipCommand = stmt->relation->relpersistence == RELPERSISTENCE_TEMP ||
3163+
(stmt->relation->schemaname && strcmp(stmt->relation->schemaname, "pg_temp") == 0);
31623164
}
31633165
break;
31643166
case T_IndexStmt:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy