Skip to content

Commit 3028dc9

Browse files
committed
fix index command for unexisintg relation; replicate create schema
1 parent eac1af3 commit 3028dc9

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

contrib/mmts/multimaster.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2451,9 +2451,13 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
24512451
"CREATE INDEX CONCURRENTLY");
24522452

24532453
relid = RelnameGetRelid(stmt->relation->relname);
2454-
rel = heap_open(relid, ShareLock);
2455-
skipCommand = rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP;
2456-
heap_close(rel, NoLock);
2454+
2455+
if (OidIsValid(relid))
2456+
{
2457+
rel = heap_open(relid, ShareLock);
2458+
skipCommand = rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP;
2459+
heap_close(rel, NoLock);
2460+
}
24572461
}
24582462
break;
24592463
case T_DropStmt:
@@ -2475,6 +2479,7 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
24752479
}
24762480
}
24772481
break;
2482+
case T_CreateSchemaStmt:
24782483
default:
24792484
skipCommand = false;
24802485
break;

0 commit comments

Comments
 (0)