Skip to content

Commit 8937e40

Browse files
committed
fix handling of implicit temp tables (pg_temp schema)
1 parent 0e22c9b commit 8937e40

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

contrib/mmts/multimaster.c

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,18 +1140,19 @@ void MtmHandleApplyError(void)
11401140
{
11411141
ErrorData *edata = CopyErrorData();
11421142
switch (edata->sqlerrcode) {
1143-
case ERRCODE_DISK_FULL:
1144-
case ERRCODE_INSUFFICIENT_RESOURCES:
1145-
case ERRCODE_IO_ERROR:
1146-
case ERRCODE_DATA_CORRUPTED:
1147-
case ERRCODE_INDEX_CORRUPTED:
1148-
case ERRCODE_SYSTEM_ERROR:
1149-
case ERRCODE_INTERNAL_ERROR:
1150-
case ERRCODE_OUT_OF_MEMORY:
1151-
elog(WARNING, "Node is excluded from cluster because of non-recoverable error %d", edata->sqlerrcode);
1152-
MtmSwitchClusterMode(MTM_OUT_OF_SERVICE);
1153-
kill(PostmasterPid, SIGQUIT);
1154-
break;
1143+
case ERRCODE_DISK_FULL:
1144+
case ERRCODE_INSUFFICIENT_RESOURCES:
1145+
case ERRCODE_IO_ERROR:
1146+
case ERRCODE_DATA_CORRUPTED:
1147+
case ERRCODE_INDEX_CORRUPTED:
1148+
case ERRCODE_SYSTEM_ERROR:
1149+
case ERRCODE_INTERNAL_ERROR:
1150+
case ERRCODE_OUT_OF_MEMORY:
1151+
elog(WARNING, "Node is excluded from cluster because of non-recoverable error %d, %s, pid=%u",
1152+
edata->sqlerrcode, edata->message, getpid());
1153+
MtmSwitchClusterMode(MTM_OUT_OF_SERVICE);
1154+
kill(PostmasterPid, SIGQUIT);
1155+
break;
11551156
}
11561157
FreeErrorData(edata);
11571158
}
@@ -3164,7 +3165,8 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
31643165
{
31653166
/* Do not replicate temp tables */
31663167
CreateStmt *stmt = (CreateStmt *) parsetree;
3167-
skipCommand = stmt->relation->relpersistence == RELPERSISTENCE_TEMP;
3168+
skipCommand = stmt->relation->relpersistence == RELPERSISTENCE_TEMP ||
3169+
(stmt->relation->schemaname && strcmp(stmt->relation->schemaname, "pg_temp") == 0);
31683170
}
31693171
break;
31703172
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