Re: privileges for ALTER ROLE/DATABASE SET

From: Noah Misch <noah(at)leadboat(dot)com>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: privileges for ALTER ROLE/DATABASE SET
Date: 2022-08-29 04:37:52
Message-ID: 20220829043752.GA288610@rfd.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jul 22, 2022 at 03:25:16PM -0700, Nathan Bossart wrote:
> On Fri, Jul 22, 2022 at 04:16:14PM -0400, Tom Lane wrote:
> > Clearly, you need enough privilege to SET the parameter, and you need
> > some sort of management privilege on the target role or DB. There
> > might be room to discuss what that per-role/DB privilege needs to be.
> > But I'm very skeptical that we need to manage this at the level
> > of the cross product of GUCs and roles/DBs, which is what you seem
> > to be proposing. That seems awfully unwieldy, and is there really
> > any use-case for it?
>
> Actually, I think my vote is to do nothing, except for perhaps updating the
> documentation to indicate that SET privileges on a parameter are sufficient
> for ALTER ROLE/DATABASE SET (given you have the other required privileges
> for altering the role/database). I can't think of a use-case for allowing
> a role to SET a GUC but not change the session default for another role.

If I wanted to argue for a use case, I'd point to ALTER ROLE/DATABASE SET
surviving REVOKE of SET privileges. Revoking a SET privilege promptly affects
future SET statements, but the REVOKE issuer would need to take the separate
step of clearing unwanted pg_db_role_setting entries. Even so, ...

> And I agree that requiring extra permissions for this feels excessive.
> Maybe someone else has a use-case in mind, though.

... I, too, vote to change nothing. We have lots of cases where REVOKE
doesn't reverse actions taken while the user held the privilege being revoked.
Changing that isn't worth much.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey Lepikhov 2022-08-29 05:05:29 Re: Removing unneeded self joins
Previous Message Tom Lane 2022-08-29 04:28:24 Re: use ARM intrinsics in pg_lfind32() where available