Thread: [MASSMAIL]REASSIGN pg_auth_members

[MASSMAIL]REASSIGN pg_auth_members

From
Étienne BERSAC
Date:
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