Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2706559

Browse files
committed
disallow concurrent index creation insise tx
1 parent08762fd commit2706559

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

‎contrib/mmts/multimaster.c‎

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2442,21 +2442,17 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
24422442
caseT_IndexStmt:
24432443
{
24442444
Oidrelid;
2445-
LOCKMODElockmode;
24462445
Relationrel;
2447-
24482446
IndexStmt*stmt= (IndexStmt*)parsetree;
2449-
lockmode=stmt->concurrent ?ShareUpdateExclusiveLock
2450-
:ShareLock;
2451-
relid=RangeVarGetRelidExtended(stmt->relation,lockmode,
2452-
false, false,
2453-
NULL,// ???
2454-
NULL);
2447+
boolisTopLevel= (context==PROCESS_UTILITY_TOPLEVEL);
24552448

2456-
rel=heap_open(relid,lockmode);
2449+
if (stmt->concurrent)
2450+
PreventTransactionChain(isTopLevel,
2451+
"CREATE INDEX CONCURRENTLY");
24572452

2453+
relid=RelnameGetRelid(stmt->relation->relname);
2454+
rel=heap_open(relid,ShareLock);
24582455
skipCommand=rel->rd_rel->relpersistence==RELPERSISTENCE_TEMP;
2459-
24602456
heap_close(rel,NoLock);
24612457
}
24622458
break;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp