Re: Orphaned users in PG16 and above can only be managed by Superusers

From: Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Andres Freund <andres(at)anarazel(dot)de>, Tomas Vondra <tomas(at)vondra(dot)me>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Orphaned users in PG16 and above can only be managed by Superusers
Date: 2025-03-10 05:45:04
Message-ID: CAE9k0Pm7sDWgNFAGRMCxDHZW6Ca3XsP9vu_GhBH9KORQ2y8=+w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Fri, Mar 7, 2025 at 10:55 PM Nathan Bossart <nathandbossart(at)gmail(dot)com> wrote:
>
> I noticed that much of this code is lifted from DropRole(), and the new
> check_drop_role_dependency() function is only used by DropRole() right
> before it does the exact same scans. Couldn't we put the new dependency
> detection in those existing scans in DropRole()?
>

It can be done, but mixing the code that checks for the drop role
dependency with the code that removes entries for the role being
dropped from pg_auth_members could reduce clarity and precision. This
is more of a sanity check which I felt was necessary before we proceed
with actually dropping the role, starting with the deletion of drop
role entries from the system catalogs. I’m aware there’s some code
duplication, but I think it should be fine.

--
With Regards,
Ashutosh Sharma.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Álvaro Herrera 2025-03-10 06:08:39 Re: Printing window function OVER clauses in EXPLAIN
Previous Message John Naylor 2025-03-10 05:35:22 Re: vacuumdb changes for stats import/export