diff --git a/src/backend/distributed/commands/table.c b/src/backend/distributed/commands/table.c index 2d96d8afd..aaadf3612 100644 --- a/src/backend/distributed/commands/table.c +++ b/src/backend/distributed/commands/table.c @@ -768,10 +768,7 @@ PreprocessAlterTableStmt(Node *node, const char *alterTableCommand, * experience by asking to add coordinator to metadata. */ - /* as we're having a table type conversion, dont need warning messages */ - InTableTypeConversionFunctionCall = true; ConvertPostgresLocalTablesToCitusLocalTables(alterTableStatement); - InTableTypeConversionFunctionCall = false; /* * CreateCitusLocalTable converts relation to a shard relation and creates @@ -1272,6 +1269,9 @@ RelationIdListContainsPostgresTable(List *relationIdList) static void ConvertPostgresLocalTablesToCitusLocalTables(AlterTableStmt *alterTableStatement) { + /* as we're having a table type conversion, dont need warning messages */ + InTableTypeConversionFunctionCall = true; + List *rightRelationRangeVarList = GetAlterTableAddFKeyRightRelationRangeVarList(alterTableStatement); RangeVar *leftRelationRangeVar = alterTableStatement->relation; @@ -1387,6 +1387,7 @@ ConvertPostgresLocalTablesToCitusLocalTables(AlterTableStmt *alterTableStatement } PG_CATCH(); { + InTableTypeConversionFunctionCall = false; MemoryContextSwitchTo(savedMemoryContext); ErrorData *errorData = CopyErrorData(); @@ -1405,6 +1406,8 @@ ConvertPostgresLocalTablesToCitusLocalTables(AlterTableStmt *alterTableStatement } PG_END_TRY(); } + + InTableTypeConversionFunctionCall = false; } diff --git a/src/test/regress/expected/view_propagation.out b/src/test/regress/expected/view_propagation.out index 1659b226b..30e163818 100644 --- a/src/test/regress/expected/view_propagation.out +++ b/src/test/regress/expected/view_propagation.out @@ -596,7 +596,7 @@ create view dependent_view_1 as select count(*) from table_to_depend_on_1; WARNING: "view dependent_view_1" has dependency to "table table_to_depend_on_1" that is not in Citus' metadata DETAIL: "view dependent_view_1" will be created only locally HINT: Distribute "table table_to_depend_on_1" first to distribute "view dependent_view_1" --- the seconds view depends on two tables +-- the second view depends on two tables create view dependent_view_2 as select count(*) from table_to_depend_on_1 join table_to_depend_on_2 on table_to_depend_on_1.a=table_to_depend_on_2.a; WARNING: "view dependent_view_2" has dependency to "table table_to_depend_on_2" that is not in Citus' metadata DETAIL: "view dependent_view_2" will be created only locally diff --git a/src/test/regress/sql/view_propagation.sql b/src/test/regress/sql/view_propagation.sql index 4ace722a2..7c46f6cc6 100644 --- a/src/test/regress/sql/view_propagation.sql +++ b/src/test/regress/sql/view_propagation.sql @@ -379,7 +379,7 @@ create table table_to_depend_on_1 (a int); create table table_to_depend_on_2 (a int); -- the first view depends on a table create view dependent_view_1 as select count(*) from table_to_depend_on_1; --- the seconds view depends on two tables +-- the second view depends on two tables create view dependent_view_2 as select count(*) from table_to_depend_on_1 join table_to_depend_on_2 on table_to_depend_on_1.a=table_to_depend_on_2.a; -- distribute only one table select create_distributed_table('table_to_depend_on_1','a');