ALTER TABLE .. CLUSTER ON and SET WITHOUT CLUSTER are not supported for partitioned tables and already fail with a check happening when the sub-command is executed, not when it is prepared. This commit moves the relkind check for partitioned tables to happen when the sub-command is prepared in ATSimplePermissions(). This matches with the practice of the other sub-commands of ALTER TABLE, shaving one translatable string. mark_index_clustered() can be a bit simplified, switching one elog(ERROR) to an assertion. Note that mark_index_clustered() can also be called through a CLUSTER command, but it cannot be reached for a partitioned table, per the assertion based on the relkind in cluster_rel(), and there is only one caller of rebuild_relation(). Author: Chao Li <li.evan.chao@gmail.com> Reviewed-by: Michael Paquier <michael@paquier.xyz> Reviewed-by: Zsolt Parragi <zsolt.parragi@percona.com> Discussion: https://postgr.es/m/CAEoWx2kggo1N2kDH6OSfXHL_5gKg3DqQ0PdNuL4LH4XSTKJ3-g@mail.gmail.com
PostgreSQL Database Management System
This directory contains the source code distribution of the PostgreSQL database management system.
PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings.
Copyright and license information can be found in the file COPYRIGHT.
General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/devel/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/devel/installation.html.
The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.