pgsql: Warn when REPACK or CLUSTER skips foreign partitions

From: Fujii Masao <fujii(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Warn when REPACK or CLUSTER skips foreign partitions
Date: 2026-10-16 15:29:51
Message-ID: E1xHjsV-00000001tm3-3CBN@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Warn when REPACK or CLUSTER skips foreign partitions

Previously, REPACK and CLUSTER silently skipped foreign-table partitions
when processing a partitioned table, leaving users unaware that some
partitions had not been processed. In contrast, VACUUM FULL warns when
skipping such partitions.

Emit a warning for each skipped foreign-table partition. Inspect the
table's partition tree even when an index is specified, because foreign
tables have no indexes and therefore do not appear in the index's
partition tree. Check privileges before issuing the warning, so that
users without the required privileges receive a permission warning
instead, as with VACUUM FULL.

Note that database-wide REPACK and CLUSTER continue to skip foreign
tables silently, consistent with database-wide VACUUM FULL.

Author: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Reviewed-by: Antonin Houska <ah(at)cybertec(dot)at>
Reviewed-by: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Reviewed-by: shihao zhong <zhong950419(at)gmail(dot)com>
Reviewed-by: Surya Poondla <suryapoondla4(at)gmail(dot)com>
Reviewed-by: solai v <solai(dot)cdac(at)gmail(dot)com>
Reviewed-by: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAN4CZFNXFdkmOCnt8m=K_A4i3LQC+59nx59Y=5bsH4vehQHTTw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/af090508018be5ace443ba6e2814500c10842a4d

Modified Files
--------------
doc/src/sgml/ref/cluster.sgml | 5 +++--
doc/src/sgml/ref/repack.sgml | 3 ++-
src/backend/commands/repack.c | 41 ++++++++++++++++++++++++++++++++++-
src/test/regress/expected/cluster.out | 36 ++++++++++++++++++++++++++++++
src/test/regress/sql/cluster.sql | 28 ++++++++++++++++++++++++
5 files changed, 109 insertions(+), 4 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2026-10-16 21:26:40 pgsql: doc: Note that plan advice does not affect cached plans
Previous Message Fujii Masao 2026-10-16 15:20:59 pgsql: Avoid spurious failures in the login event trigger recovery test