Skip to content

AZ618: The owner may not switch to the app role ​

rowfence test (its as user ... checks), sql --as, explain-rule, plans, bench and Studio look at the data as the app does: they switch to the app role with SET ROLE, in a transaction that is rolled back. The role the command connects as has to hold the app role for that. A superuser always does. Since PostgreSQL 16 a role that makes another (CREATE ROLE app_user) only administers it, so an owner that isn't a superuser, as on managed Postgres, gives itself the role once: GRANT app_user TO app_owner. It may, because it made the role. Nothing changes for the app, which connects as the app role itself.

Reported by the command, against a database.