Re: vacuumdb --missing-stats-only and permission issue

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: vacuumdb --missing-stats-only and permission issue
Date: 2025-08-21 18:07:10
Message-ID: aKdgTiSpo8p_YVgX@nathan
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Aug 21, 2025 at 12:59:52PM -0500, Nathan Bossart wrote:
> I think there's a problem with the privilege checks for pg_stats (and
> friends) versus ANALYZE. pg_stats checks for SELECT privileges on the
> column, while ANALYZE checks for MAINTAIN privileges. If a role lacks
> SELECT on the columns, it will always try to analyze the table. If a role
> lacks MAINTAIN on the table, it will fail if it tries to analyze the table.

Unfortunately, pg_stats_ext is also different. The data for that view is
restricted to table owners (or roles that inherit privileges of the table
owner).

--
nathan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Antonin Houska 2025-08-21 18:14:14 Re: Adding REPACK [concurrently]
Previous Message Antonin Houska 2025-08-21 18:07:04 Re: Adding REPACK [concurrently]