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

From Nathan Bossart
Subject Re: vacuumdb --missing-stats-only and permission issue
Date
Msg-id aKdgTiSpo8p_YVgX@nathan
Whole thread Raw
In response to Re: vacuumdb --missing-stats-only and permission issue  (Nathan Bossart <nathandbossart@gmail.com>)
Responses Re: vacuumdb --missing-stats-only and permission issue
List 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



pgsql-hackers by date:

Previous
From: Antonin Houska
Date:
Subject: Re: Adding REPACK [concurrently]
Next
From: Antonin Houska
Date:
Subject: Re: Adding REPACK [concurrently]