Environment:
- Azure Database for PostgreSQL — Flexible Server
- PostgreSQL version: 14.20
- Admin user: adopt (created at server provisioning)
- wal_level: logical
- max_replication_slots: 10
- max_wal_senders: 10
Problem:
I need to migrate my database from Azure PostgreSQL Flexible Server to AWS using AWS DMS (Database Migration Service). DMS requires the source user to have the REPLICATION attribute to establish logical replication. However, I cannot grant REPLICATION to any role. All of the following fail with permission denied:
-- Attempt 1: ALTER existing admin user
ALTER ROLE adopt WITH REPLICATION;
-- ERROR: permission denied
-- Attempt 2: SET ROLE to azuresu
SET ROLE azuresu;
-- ERROR: permission denied to set role "azuresu"
-- Attempt 3: SET ROLE to azure_pg_admin, then ALTER
SET ROLE azure_pg_admin;
ALTER ROLE adopt WITH REPLICATION;
-- ERROR: permission denied
-- Attempt 4: Create a new role with REPLICATION
SET ROLE azure_pg_admin;
CREATE ROLE dms_user WITH LOGIN PASSWORD '***' REPLICATION;
-- ERROR: permission denied to create role
Current role attributes:
| Role |
rolsuper 2 |
rolreplication |
rolcreaterole |
| azuresu |
true |
true |
true |
| azure_pg_admin |
false |
false |
false |
| adopt |
false |
false |
true |
The admin user adopt is a member of azure_pg_admin, but azure_pg_admin itself does not have rolreplication. I understand that in PostgreSQL 14, only a superuser can grant the REPLICATION attribute, and azuresu is not accessible to customers.
AWS DMS error:
Last Error: Unable to use plugins to establish logical replication on source PostgreSQL instance. Follow all prerequisites for 'PostgreSQL as a source in DMS' from https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.PostgreSQL.html
Stop Reason: FATAL_ERROR
What I've tried:
- Confirmed wal_level = logical is active (SHOW wal_level returns logical)
- All tables have primary keys
- Server parameters for replication are properly configured
- Tested creating a replication slot manually — fails with "must be superuser or replication role to use replication slots"
Request:
Could Microsoft support grant the REPLICATION attribute to the admin user adopt (or to azure_pg_admin) via the internal azuresu role? This is required for logical replication to work with AWS DMS. Alternatively, is there another supported method to enable logical replication for migration purposes on Flexible Server with PostgreSQL 14?