vacuumdb --missing-stats-only and permission issue
Fujii Masao <masao.fujii@gmail.com>
From: Fujii Masao <masao.fujii@gmail.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-08-21T03:06:32Z
Lists: pgsql-hackers
Hi, While following the discussion on vacuumdb --missing-stats-only [1], I noticed that this option queries pg_statistic and pg_statistic_ext_data. As a result, non-superusers like pg_maintain cannot use it because by default they lack permission to access those catalogs. I'm not sure whether --missing-stats-only was intended to work for non-superusers, but if so, this restriction is inconvenient. Would it make sense to use the views pg_stats and pg_stats_ext instead? Since the catalogs are only consulted to check whether statistics exist, the views should be sufficient. Thought? Regards, [1] https://postgr.es/m/20250820104226.8ba51e43164cd590b863ce41@sraoss.co.jp -- Fujii Masao
Commits
-
Document privileges required for vacuumdb --missing-stats-only.
- 984d7165dde7 19 (unreleased) landed
- 6b34e2157539 18.0 landed