Fix pg_stat_progress_cluster command reporting for unprivileged users

Previously, when another session ran REPACK, CLUSTER, or VACUUM FULL and
the user lacked permission to view its progress details,
pg_stat_progress_cluster incorrectly reported the command as CLUSTER
instead of NULL.

pg_stat_progress_cluster is based on pg_stat_progress_repack and
translates REPACK into CLUSTER or VACUUM FULL depending on whether index
ordering is requested. However, this translation defaulted to CLUSTER,
incorrectly converting NULL commands returned for insufficient privileges
into CLUSTER.

Fix this translation to preserve a NULL command when the user lacks
permission to view the progress details.

Bump catalog version.

Author: Zsolt Parragi <[email protected]>
Reviewed-by: Fujii Masao <[email protected]>
Reviewed-by: Chao Li <[email protected]>
Discussion: 
https://postgr.es/m/CAN4CZFMzy2V_wvRCBW5K8=wVCk1-C7nq=8otXO=u+s_1kzh...@mail.gmail.com
Backpatch-through: 19

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/054c1c3e650b2fe0c44570a59bc4ea05bd2ac142

Modified Files
--------------
src/backend/catalog/system_views.sql | 5 +++--
src/include/catalog/catversion.h     | 2 +-
src/test/regress/expected/rules.out  | 5 +++--
3 files changed, 7 insertions(+), 5 deletions(-)

Reply via email to