diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index 3bfaa663699..09066db0956 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -572,11 +572,7 @@ mark_index_clustered(Relation rel, Oid indexOid, bool is_internal) Relation pg_index; ListCell *index; - /* Disallow applying to a partitioned table */ - if (rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE) - ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot mark index clustered in partitioned table"))); + Assert(rel->rd_rel->relkind != RELKIND_PARTITIONED_TABLE); /* * If the index is already marked clustered, no need to do anything. diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index a2e3b72f156..991f3b85df7 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -5164,7 +5164,7 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd, case AT_ClusterOn: /* CLUSTER ON */ case AT_DropCluster: /* SET WITHOUT CLUSTER */ ATSimplePermissions(cmd->subtype, rel, - ATT_TABLE | ATT_PARTITIONED_TABLE | ATT_MATVIEW); + ATT_TABLE | ATT_MATVIEW); /* These commands never recurse */ /* No command-specific prep needed */ pass = AT_PASS_MISC; diff --git a/src/test/regress/expected/cluster.out b/src/test/regress/expected/cluster.out index 24b0b1a8fce..269f163efa6 100644 --- a/src/test/regress/expected/cluster.out +++ b/src/test/regress/expected/cluster.out @@ -492,9 +492,11 @@ Number of partitions: 3 (Use \d+ to list them.) CLUSTER clstrpart; ERROR: there is no previously clustered index for table "clstrpart" ALTER TABLE clstrpart SET WITHOUT CLUSTER; -ERROR: cannot mark index clustered in partitioned table +ERROR: ALTER action SET WITHOUT CLUSTER cannot be performed on relation "clstrpart" +DETAIL: This operation is not supported for partitioned tables. ALTER TABLE clstrpart CLUSTER ON clstrpart_idx; -ERROR: cannot mark index clustered in partitioned table +ERROR: ALTER action CLUSTER ON cannot be performed on relation "clstrpart" +DETAIL: This operation is not supported for partitioned tables. -- and they cannot get an index-ordered REPACK without an explicit index name REPACK clstrpart USING INDEX; ERROR: cannot execute REPACK on partitioned table "clstrpart" USING INDEX with no index name