We are having an issue after what seems to be a recent upgrade from postgresql 11.11 to 11.12. We create a new non-superuser role and wish to create a new database owned by this role. We wish to grant this role to the admin account created during deployment. This was working fine up to yesterday, but suddenly this started failing for our new test deployments.
An example of the type of sql we are running:
-- we are logged in using the account created during deploy of the managed postgres environment
-- we create a non-superuser role
CREATE ROLE 'foobar' WITH
LOGIN
NOSUPERUSER
NOCREATEDB
CREATEROLE
INHERIT
NOREPLICATION
PASSWORD 'test123';
-- and wish to grant that role to the admin user created during ARM deploy
-- after that we want to create a new database within our environment owned by this role
-- however this grant fails with: SQL Error [42501]: ERROR: only superusers can grant role 'pg_execute_server_program'
GRANT 'foobar' TO current_user;
CREATE DATABASE foobardb
WITH
OWNER = foobar
ENCODING = 'UTF8'
CONNECTION LIMIT = -1;
ALTER DATABASE foobardb SET search_path = public, extensions;
We have opened a support ticket for this as well.