On Sat, Aug 23, 2025 at 05:32:30AM -0400, Corey Huinker wrote:
> On Fri, Aug 22, 2025 at 11:20 PM Fujii Masao <masao.fu...@gmail.com> wrote:
>> On Sat, Aug 23, 2025 at 12:00 PM Nathan Bossart <nathandboss...@gmail.com> 
>> wrote:
>>> Hm.  Maybe we should just document that the option requires SELECT
>>> privileges on pg_statistic and pg_statistic_ext_data (which are restricted
>>> to superusers by default).  I suspect we have relatively limited
>>> opportunities for tuning the query, and I'd like to avoid invasive changes
>>> to v18 at this point.
>>
>> Yeah, adding a note about the permissions required for --missing-stats-only,
>> leaving the query unchanged in v18, and revisiting the issue in v19 seems
>> reasonable given the limited time before the v18 release.
> 
> Rather than resorting to the redundant where-clause trick that we did in
> pg_dump.

Here's a patch for the documentation update.

-- 
nathan
>From 9996ef5e8e875cfbea641545bd615deb98654816 Mon Sep 17 00:00:00 2001
From: Nathan Bossart <nat...@postgresql.org>
Date: Sat, 23 Aug 2025 09:33:53 -0500
Subject: [PATCH v4 1/1] doc: Note privileges required for vacuumdb
 --missing-stats-only.

---
 doc/src/sgml/ref/vacuumdb.sgml | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/doc/src/sgml/ref/vacuumdb.sgml b/doc/src/sgml/ref/vacuumdb.sgml
index 53147480515..84c76d7350c 100644
--- a/doc/src/sgml/ref/vacuumdb.sgml
+++ b/doc/src/sgml/ref/vacuumdb.sgml
@@ -292,6 +292,14 @@ PostgreSQL documentation
         This option can only be used in conjunction with
         <option>--analyze-only</option> or 
<option>--analyze-in-stages</option>.
        </para>
+       <para>
+        Note that <option>--missing-stats-only</option> requires
+        <literal>SELECT</literal> privileges on
+        <link 
linkend="catalog-pg-statistic"><structname>pg_statistic</structname></link>
+        and
+        <link 
linkend="catalog-pg-statistic-ext-data"><structname>pg_statistic_ext_data</structname></link>,
+        which are restricted to superusers by default.
+       </para>
       </listitem>
      </varlistentry>
 
-- 
2.39.5 (Apple Git-154)

Reply via email to