diff --git a/src/backend/distributed/commands/table.c b/src/backend/distributed/commands/table.c index fa47db87c..f659f3b24 100644 --- a/src/backend/distributed/commands/table.c +++ b/src/backend/distributed/commands/table.c @@ -280,7 +280,7 @@ PostprocessAlterTableStmtAttachPartition(AlterTableStmt *alterTableStatement, if (!IsCitusTable(relationId) && IsCitusTable(partitionRelationId)) { - char *parentRelationName = get_rel_name(partitionRelationId); + char *parentRelationName = get_rel_name(relationId); ereport(ERROR, (errmsg("non-distributed tables cannot have " "distributed partitions"), diff --git a/src/test/regress/expected/multi_partitioning.out b/src/test/regress/expected/multi_partitioning.out index c11d800b2..0c148a188 100644 --- a/src/test/regress/expected/multi_partitioning.out +++ b/src/test/regress/expected/multi_partitioning.out @@ -295,7 +295,7 @@ SELECT create_distributed_table('partitioning_test_failure_2009', 'id'); ALTER TABLE partitioning_test_failure ATTACH PARTITION partitioning_test_failure_2009 FOR VALUES FROM ('2009-01-01') TO ('2010-01-01'); ERROR: non-distributed tables cannot have distributed partitions -HINT: Distribute the partitioned table "partitioning_test_failure_2009" instead +HINT: Distribute the partitioned table "partitioning_test_failure" instead -- multi-level partitioning is not allowed DROP TABLE partitioning_test_failure_2009; CREATE TABLE partitioning_test_failure_2009 PARTITION OF partitioning_test_failure FOR VALUES FROM ('2009-01-01') TO ('2010-01-01') PARTITION BY RANGE (time);