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

Commit3cdb373

Browse files
committed
disallow concurrent index creation insise tx
1 parent9bacc10 commit3cdb373

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

‎multimaster.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2437,21 +2437,17 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
24372437
caseT_IndexStmt:
24382438
{
24392439
Oidrelid;
2440-
LOCKMODElockmode;
24412440
Relationrel;
2442-
24432441
IndexStmt*stmt= (IndexStmt*)parsetree;
2444-
lockmode=stmt->concurrent ?ShareUpdateExclusiveLock
2445-
:ShareLock;
2446-
relid=RangeVarGetRelidExtended(stmt->relation,lockmode,
2447-
false, false,
2448-
NULL,// ???
2449-
NULL);
2442+
boolisTopLevel= (context==PROCESS_UTILITY_TOPLEVEL);
24502443

2451-
rel=heap_open(relid,lockmode);
2444+
if (stmt->concurrent)
2445+
PreventTransactionChain(isTopLevel,
2446+
"CREATE INDEX CONCURRENTLY");
24522447

2448+
relid=RelnameGetRelid(stmt->relation->relname);
2449+
rel=heap_open(relid,ShareLock);
24532450
skipCommand=rel->rd_rel->relpersistence==RELPERSISTENCE_TEMP;
2454-
24552451
heap_close(rel,NoLock);
24562452
}
24572453
break;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp