Azure Database for PostgreSQL: Role attribute mismatch and BYPASSRLS permissions — Backup issue inquiry

Stephen Scott 0 Reputation points
2026-11-24T12:05:08.9333333+00:00

Problem description

I am experiencing an issue with backup attempts on my Azure Database for PostgreSQL flexible server, specifically regarding the BYPASSRLS attribute on the administrator role. The problem started on 2026-11-09, and I noticed that the built-in administrator login on my server, uks-eoe-prd-postgre, shows 'rolbypassrls = false', whereas on a comparable server where backups are successful, it shows 'rolbypassrls = true'. I need clarification on whether Azure can restore or modify this permission to match my other servers.

Environment

Azure Database for PostgreSQL flexible server, PostgreSQL 14.24, region not specified, affected server: uks-eoe-prd-postgre.

What I've already tried

I have verified the PostgreSQL version and the role membership of azure_pg_admin. I confirmed that no restore has occurred and that the backup vendor considers the BYPASSRLS attribute necessary on the login itself. I also compared the role attribute between servers and checked the current role attributes and permissions.

Current status

I am seeking guidance on whether Azure can restore or modify the BYPASSRLS attribute for the administrator role to match my other servers, and to understand the platform limitations regarding this permission.

Azure Database for PostgreSQL
0 comments No comments

1 answer

Sort by: Most helpful
  1. SHOUMIK CHAKRAVARTY 1,710 Reputation points
    2026-11-25T14:42:59.48+00:00

    Hi @Stephen Scott , welcome to the Microsoft Azure QnA.

    Based on the documented privilege model for Flexible Server, rolbypassrls = false on the admin account is expected. From Manage users in Azure Database for PostgreSQL flexible server:

    "In Azure Database for PostgreSQL, the server admin user is granted these privileges: Sign in, NOSUPERUSER, INHERIT, CREATEDB, CREATEROLE"

    "Since this service is a managed PaaS service, only Microsoft is part of the super user role."

    And PostgreSQL restricts the BYPASSRLS attribute to superusers. From the PostgreSQL 14 CREATE ROLE reference:

    "You must be a superuser to create a new role having the BYPASSRLS attribute."

    The reported difference between the two servers is worth investigating further before concluding that a platform change occurred.

    On the backup itself, the same CREATE ROLE page has a note that may be closer to your actual error:

    "Note that pg_dump will set row_security to OFF by default, to ensure all contents of a table are dumped out. If the user running pg_dump does not have appropriate permissions, an error will be returned. However, superusers and the owner of the table being dumped always bypass RLS."

    So if your vendor uses pg_dump, row_security is already off by default and the failure would be the permissions error rather than silently missing rows. If the backup is being run by the table owner, PostgreSQL normally bypasses RLS for that role, unless FORCE ROW LEVEL SECURITY has been enabled on the table.

    Running this on both servers should help explain the difference:

    SELECT current_setting('server_version'),
           rolname,
           rolsuper,
           rolbypassrls
    FROM pg_roles
    WHERE rolname NOT LIKE 'pg\_%'
    ORDER BY rolname;
    

    If the working server turns out to be a Single Server rather than a Flexible Server, or the attribute sits on a role other than the built-in admin, that would account for it. Sharing the output along with the exact error your backup is throwing would help narrow it down.

    If this helped clarify things, please accept the answer or leave an upvote so others can find it.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.