Reject CLUSTER (ANALYZE).
The introduction of the REPACK command also added support for
CLUSTER (ANALYZE). Presumably this was unintentional, as the
CLUSTER docs make no mention of it. CLUSTER (ANALYZE) on an
ordinary table succeeds and does indeed analyze the table, but a
database-wide CLUSTER (ANALYZE) or one on a partitioned table
fails with an error like:
ERROR: cannot execute REPACK (ANALYZE) on multiple tables
Rather than improving support for CLUSTER (ANALYZE) and thereby
encouraging folks to use CLUSTER instead of REPACK, let's just
reject it. This commit does so by teaching ExecRepack() to ERROR
for the ANALYZE option in anything except REPACK commands. Note
that VACUUM (FULL, ANALYZE) does not go through ExecRepack() and
therefore is unaffected by this change.
Oversight in commit ac58465e06.
Reported-by: Zsolt Parragi <[email protected]>
Author: Zsolt Parragi <[email protected]>
Discussion:
https://postgr.es/m/CAN4CZFMVcgv1b2G-i%2Bkhs2MDnzWSr7O_53j_x%2BuhAxUV5rwWqw%40mail.gmail.com
Backpatch-through: 19
Branch
------
REL_19_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/d7db169fa13a7e4db9013816c7a2c498bd304fba
Modified Files
--------------
src/backend/commands/repack.c | 7 +++++++
1 file changed, 7 insertions(+)