From 942f1a2c48c02280c80e401fc6e0a19c3ffba822 Mon Sep 17 00:00:00 2001 From: Burak Velioglu Date: Fri, 7 Jan 2022 12:55:47 +0300 Subject: [PATCH] Revert local sequence break change --- src/backend/distributed/commands/alter_table.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/backend/distributed/commands/alter_table.c b/src/backend/distributed/commands/alter_table.c index e01d44eca..5364d49cc 100644 --- a/src/backend/distributed/commands/alter_table.c +++ b/src/backend/distributed/commands/alter_table.c @@ -195,7 +195,7 @@ static void CreateDistributedTableLike(TableConversionState *con); static void CreateCitusTableLike(TableConversionState *con); static List * GetViewCreationCommandsOfTable(Oid relationId); static void ReplaceTable(Oid sourceId, Oid targetId, List *justBeforeDropCommands, - bool suppressNoticeMessages, char conversionType); + bool suppressNoticeMessages); static bool HasAnyGeneratedStoredColumns(Oid relationId); static List * GetNonGeneratedStoredColumnNameList(Oid relationId); static void CheckAlterDistributedTableConversionParameters(TableConversionState *con); @@ -741,7 +741,7 @@ ConvertTable(TableConversionState *con) } ReplaceTable(con->relationId, con->newRelationId, justBeforeDropCommands, - con->suppressNoticeMessages, con->conversionType); + con->suppressNoticeMessages); TableDDLCommand *tableConstructionCommand = NULL; foreach_ptr(tableConstructionCommand, postLoadCommands) @@ -1295,7 +1295,7 @@ GetViewCreationCommandsOfTable(Oid relationId) */ void ReplaceTable(Oid sourceId, Oid targetId, List *justBeforeDropCommands, - bool suppressNoticeMessages, char conversionType) + bool suppressNoticeMessages) { char *sourceName = get_rel_name(sourceId); char *targetName = get_rel_name(targetId); @@ -1353,15 +1353,6 @@ ReplaceTable(Oid sourceId, Oid targetId, List *justBeforeDropCommands, changeDependencyFor(RelationRelationId, sequenceOid, RelationRelationId, sourceId, targetId); - /* Changing the dependency for sequence will prevent PG to have */ - /* sequence within drop trigger */ - if (conversionType == UNDISTRIBUTE_TABLE) - { - ObjectAddress sequenceAddress = { 0 }; - ObjectAddressSet(sequenceAddress, RelationRelationId, sequenceOid); - UnmarkObjectDistributed(&sequenceAddress); - } - /* * Skip if we cannot sync metadata for target table. * Checking only for the target table is sufficient since we will