vacuumdb --missing-stats-only and permission issue

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: vacuumdb --missing-stats-only and permission issue
Date: 2025-08-21 03:06:32
Message-ID: CAHGQGwHh43suEfss1wvBsk7vqiou=UY0zcy8HGyE5hBp+HZ7SQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zhijie Hou (Fujitsu) 2025-08-21 03:41:30 RE: Fix replica identity checks for MERGE command on published table.
Previous Message Michael Paquier 2025-08-21 02:57:58 Re: Sequence Access Methods, round two