An Azure managed PostgreSQL database service for app development and deployment.
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
BYPASSRLSattribute."
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_securitytoOFFby 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.