0

I'm trying to alter the default privileges of a role (roleB) that I am a member of, to allow it to modify objects created by another role (roleA) that I am also a member of.

I have the inherit attribute set on my role.

This is on a PostgreSQL 16 instance in Azure (Azure Database for PostgreSQL flexible server).

Example errors:

Cannot execute SQL

ALTER DEFAULT PRIVILEGES FOR ROLE "roleA" REVOKE ALL ON SEQUENCES FROM "roleB";
ALTER DEFAULT PRIVILEGES FOR ROLE "roleA" GRANT USAGE,UPDATE,SELECT ON SEQUENCES TO "roleB";

permission denied to change default privileges

6
  • If your current user is a member of "roleA", these statements will succeed. Perhaps you are using a modified version of PostgreSQL? Note that the statements might not do what you want, since they don't affect objects created by "roleB". Commented Jun 18 at 12:52
  • @LaurenzAlbe I mixed up the order of roles I believe. Edited that now, thanks! The database is on an Azure Database for PostgreSQL flexible server but I don't believe that should make any difference.
    – gpat
    Commented Jun 19 at 7:54
  • Well, then the case is simple: you must be a member of "roleA" (or a superuser) to run that statement. That the database is on Azure is significant. All hosting providers have hacked up PostgreSQL one way or the other, and that often affects permissions. Commented Jun 19 at 8:12
  • Interesting. I'm a member of both roles (with admin) but still can't get this to work. I haven't found any Azure specific documentation of this behaviour but I guess I'll keep looking and create a support request as well.
    – gpat
    Commented Jun 19 at 8:19
  • Just a sanity check: those backslashes are not really in your SQL statement, are they? Commented Jun 19 at 9:32

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.