pgsql: Warn when REPACK or CLUSTER skips foreign partitions

Started by Fujii Masaoabout 1 month ago1 messagescommitters
Jump to latest
#1Fujii Masao
fujii@postgresql.org

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.parragi@percona.com>
Reviewed-by: Antonin Houska <ah@cybertec.at>
Reviewed-by: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Reviewed-by: shihao zhong <zhong950419@gmail.com>
Reviewed-by: Surya Poondla <suryapoondla4@gmail.com>
Reviewed-by: solai v <solai.cdac@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: /messages/by-id/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(-)