This works in PG 15:

        CREATE ROLE service CREATEROLE;
        CREATE ROLE service1 WITH LOGIN IN ROLE service;
        SET SESSION AUTHORIZATION service;
        CREATE ROLE service2 WITH LOGIN IN ROLE service;

but generates an error in git master:

        CREATE ROLE service CREATEROLE;
        CREATE ROLE service1 WITH LOGIN IN ROLE service;
        SET SESSION AUTHORIZATION service;
        CREATE ROLE service2 WITH LOGIN IN ROLE service;
-->     ERROR:  must have admin option on role "service"

If I make 'service' a superuser, it works:

        CREATE ROLE service SUPERUSER;
        CREATE ROLE service1 WITH LOGIN IN ROLE service;
        SET SESSION AUTHORIZATION service;
        CREATE ROLE service2 WITH LOGIN IN ROLE service;

It is probably related to this discussion and change:

       
https://www.postgresql.org/message-id/flat/CA+TgmobGds7oefDjZUY+k_J7p1sS=pTq3sZ060qdb=okei1...@mail.gmail.com

I am not sure if the behavior is wrong, the error message is wrong, or
it is working as expected.

-- 
  Bruce Momjian  <br...@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

Embrace your flaws.  They make you human, rather than perfect,
which you will never be.


Reply via email to