Hello,
I'd like to ask you about resource Azure Database for PostgreSQL server please.
I'm trying to create new user/role on my PostgreSQL database and then grant this role to my admin user. I have DEV environment that is created only when needed and this scenario successfully worked last 14 months. Everytime, there were created new database role (for my application db schema) and this role was granted to my admin user so it could work properly and had correct permissions.
However, this Monday Azure PostgreSQL started to answer with this error message to my db migration:
Migrating schema "<application-schema-name>" to version "<version>" - create users
ERROR: Migration of schema "<application-schema-name>" to version "<version>" - create users failed! Changes successfully rolled back.
ERROR:
Migration V1__create_users.sql failed
--------------------------------------------------
SQL State : 42501
Error Code : 0
Message : ERROR: **only superusers can grant role "pg_execute_server_program"**
Location : /flyway/sql/01_schema/V1__create_users.sql (/flyway/sql/01_schema/V1__create_users.sql)
Line : 5
Statement : grant "<application-schema-name>" to "<my-admin-user>"
When I try to execute this query manually on older Azure PostgreSQL databases that I have created last year, it runs successfully and there in no error at all - user is created, role is granted.
I understand that I'm not able to run queries as superuser but I never tried to. There wasn't any problem with this query last 14 months so I'm quite confused right now because my database cannot be created in desired way. Is there anything that might change in Azure PostgreSQL server resource that might be reason of this error that I'm experiencing?
Thank you for your answers.
Oliver