DROP OWNED fails when the owner and a grantee of a default ACL are listed together
Thread notes
1 note#bug
hackorum-bot#bug
@global #bug
Hi
DROP OWNED fails when one listed role owns a default ACL and another
listed role is its grantee, and the owner comes first in the list ..
== master =
psql (20devel)
Type "help" for help.
postgres=# create role a;
CREATE ROLE
postgres=# create role b;
CREATE ROLE
postgres=# alter default privileges for role a grant select on tables to b;
ALTER DEFAULT PRIVILEGES
postgres=# drop owned by a, b;
ERROR: could not find tuple for default ACL 16391
... the inverted order works though:
postgres=# drop owned by b, a;
DROP OWNED
I could reproduce this on PG15. The attached patch remembers the default
ACLs that shdepDropOwned() has scheduled for deletion and skips ACL
entries of those.
== patch ==
psql (20devel)
Type "help" for help.
postgres=# create role a;
CREATE ROLE
postgres=# create role b;
CREATE ROLE
postgres=# alter default privileges for role a grant select on tables to b;
ALTER DEFAULT PRIVILEGES
postgres=# drop owned by a, b;
DROP OWNED
Thoughts?
Best, Jim