REASSIGN pg_auth_members

From: Étienne BERSAC <etienne(dot)bersac(at)dalibo(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: REASSIGN pg_auth_members
Date: 2024-04-04 07:09:19
Message-ID: dbfd6ee6d4e1d5a9c7ae019a50968ae199436745.camel@dalibo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I encounter a new behaviour in Postgres 16: DROP OWNED BY drops
memberships when dropping grantor of memberhsip. A call on REASSIGN
OWNED BY does not reassign membership from grantor to target owner.

Attached is a script my-reassign.sql which reproduce the behaviour.
Just run it with psql -f to reproduce. If you get *MEMBERSHIP LOST!!*
message, then the DROP OWNED BY "unexpectedly" dropped the membership.

This script run smoothly on Postgres 15. Membership is survives drop of
grantor.

What do you think of this ? How to change grantor of memberships before
dropping the grantor role ? Should we fix REASSIGN to change grantor in
pg_auth_members ?

Regards,
Étienne BERSAC
Dalibo

Attachment Content-Type Size
my-reassign.sql application/sql 746 bytes

Browse pgsql-hackers by date

  From Date Subject
Next Message Dagfinn Ilmari Mannsåker 2024-04-04 07:44:25 Re: Using the %m printf format more
Previous Message David Rowley 2024-04-04 07:02:43 Re: Streaming read-ready sequential scan code