vacuumdb --missing-stats-only and permission issue - Mailing list pgsql-hackers

From Fujii Masao
Subject vacuumdb --missing-stats-only and permission issue
Date
Msg-id CAHGQGwHh43suEfss1wvBsk7vqiou=UY0zcy8HGyE5hBp+HZ7SQ@mail.gmail.com
Whole thread Raw
Responses Re: vacuumdb --missing-stats-only and permission issue
List 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



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Sequence Access Methods, round two
Next
From: "Zhijie Hou (Fujitsu)"
Date:
Subject: RE: Fix replica identity checks for MERGE command on published table.