From 8c240186798ef385bb60a5a519ba0bacb722b5d3 Mon Sep 17 00:00:00 2001 From: Onur Tirtir Date: Tue, 5 Jan 2021 14:07:38 +0300 Subject: [PATCH] fixup! Cover postgres tables for CREATE TABLE commands when pg<13 --- src/backend/distributed/commands/table.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/backend/distributed/commands/table.c b/src/backend/distributed/commands/table.c index 3afc324a3..4e002f9ac 100644 --- a/src/backend/distributed/commands/table.c +++ b/src/backend/distributed/commands/table.c @@ -118,25 +118,25 @@ PreprocessDropTableStmt(Node *node, const char *queryString) 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 */ if ((TableReferenced(relationId) || TableReferencing(relationId))) { MarkInvalidateForeignKeyGraph(); } - /* we're not interested in non-distributed relations */ + /* we're not interested in non-distributed relations for the rest */ if (!IsCitusTable(relationId)) { continue; } + if (IsCitusTableType(relationId, REFERENCE_TABLE)) + { + /* prevent concurrent EnsureReferenceTablesExistOnAllNodes */ + int colocationId = CreateReferenceTableColocationId(); + LockColocationId(colocationId, ExclusiveLock); + } + /* we're only interested in partitioned and mx tables */ if (!ShouldSyncTableMetadata(relationId) || !PartitionedTable(relationId)) {