REASSIGN pg_auth_members

Started by Étienne BERSACover 2 years ago1 messageshackers

Thread notes

1 note#bug
hackorum-bot#bug
hackorum-bot
1 day ago

@global #bug

#bug
Jump to latest
#1Étienne BERSAC
etienne.bersac@dalibo.com

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

Attachments:

my-reassign.sqlapplication/sql; name=my-reassign.sqlDownload