Re: Tying an object's ownership to datdba

From: Noah Misch <noah(at)leadboat(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Tying an object's ownership to datdba
Date: 2021-03-15 09:41:20
Message-ID: 20210315094120.GA3295464@rfd.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

A cfbot failure showed I had missed ORDER BY in some test queries.

On Sun, Dec 27, 2020 at 08:31:48PM -0800, Noah Misch wrote:
> I ended up blocking DDL that creates role memberships involving the new role;
> see reasons in user.c comments. Lifting those restrictions looked feasible,
> but it was inessential to the mission, and avoiding unintended consequences
> would have been tricky.

Later, I pondered the case of pg_database_owner owning a shared object
(database or tablespace). The behavior is certainly odd. For a tablespace,
any database owner can act as the tablespace owner (but only when connected to
a database that the role owns). For a database, likewise. When connected to
a database having datdba=pg_database_owner, no particular role acts as the
owner, just superusers and SECURITY DEFINER functions owned by
pg_database_owner. I don't have high hopes for that being useful, but I
couldn't quite convince myself to ban it. Attached v2 does expand an
AddRoleMems() comment to discuss this, though.

Attachment Content-Type Size
dedup-roles_is_member_of-v1.patch text/plain 12.3 KB
pg_database_owner-v2.patch text/plain 16.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Julien Rouhaud 2021-03-15 10:21:55 Re: Extensions not dumped when --schema is used
Previous Message houzj.fnst@fujitsu.com 2021-03-15 09:35:58 RE: Parallel INSERT (INTO ... SELECT ...)