Re: pg_maintain and USAGE privilege on schema

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_maintain and USAGE privilege on schema
Date: 2024-07-10 14:04:24
Message-ID: Zo6U6I4b82th7QqT@nathan
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jul 10, 2024 at 05:13:58PM +0900, Fujii Masao wrote:
> However, unlike the database owner, pg_maintain by definition should
> have *all* the rights needed for maintenance tasks, including MAINTAIN
> rights on tables and USAGE rights on schemas? ISTM that both
> pg_read_all_data and pg_write_all_data roles are defined similarly,
> with USAGE rights on all schemas. So, granting USAGE rights to
> pg_maintain, but not the database owner, doesn't seem so odd to me.

It doesn't seem so odd to me, either. But there are other things that
could prevent a role with privileges of pg_maintain from being able to
VACUUM a table. For example, the role might not have LOGIN, or it might
not have CONNECT on the database. I think the argument for giving
pg_maintain roles implicit USAGE on all schemas for only maintenance
commands is that we already do that in some cases (e.g., a database-wide
VACUUM).

> I'd like hear more opinions about this.

+1

--
nathan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2024-07-10 14:10:30 Re: Add a GUC check hook to ensure summarize_wal cannot be enabled when wal_level is minimal
Previous Message Andrew Dunstan 2024-07-10 14:03:50 Re: tests fail on windows with default git settings