fixup! Cover postgres tables for CREATE TABLE commands when pg<13

pull/4453/head
Onur Tirtir 2021-01-05 14:07:38 +03:00
parent 154c5baaa0
commit 8c24018679
1 changed files with 8 additions and 8 deletions

View File

@ -118,25 +118,25 @@ PreprocessDropTableStmt(Node *node, const char *queryString)
continue; continue;
} }
if (IsCitusTableType(relationId, REFERENCE_TABLE))
{
/* prevent concurrent EnsureReferenceTablesExistOnAllNodes */
int colocationId = CreateReferenceTableColocationId();
LockColocationId(colocationId, ExclusiveLock);
}
/* invalidate foreign key cache if the table involved in any foreign key */ /* invalidate foreign key cache if the table involved in any foreign key */
if ((TableReferenced(relationId) || TableReferencing(relationId))) if ((TableReferenced(relationId) || TableReferencing(relationId)))
{ {
MarkInvalidateForeignKeyGraph(); MarkInvalidateForeignKeyGraph();
} }
/* we're not interested in non-distributed relations */ /* we're not interested in non-distributed relations for the rest */
if (!IsCitusTable(relationId)) if (!IsCitusTable(relationId))
{ {
continue; continue;
} }
if (IsCitusTableType(relationId, REFERENCE_TABLE))
{
/* prevent concurrent EnsureReferenceTablesExistOnAllNodes */
int colocationId = CreateReferenceTableColocationId();
LockColocationId(colocationId, ExclusiveLock);
}
/* we're only interested in partitioned and mx tables */ /* we're only interested in partitioned and mx tables */
if (!ShouldSyncTableMetadata(relationId) || !PartitionedTable(relationId)) if (!ShouldSyncTableMetadata(relationId) || !PartitionedTable(relationId))
{ {