Test row security as the application role
An administrator’s query can bypass the boundary under review.
Identify the effective role
PostgreSQL 17 applies default denial when row security is enabled and no applicable policy exists. Table owners normally bypass row security; superusers and roles with BYPASSRLS always bypass it. FORCE ROW LEVEL SECURITY can subject the owner to policies, but does not remove the superuser or BYPASSRLS exceptions.
Record the actual connection role and any role switching used by the application. A policy exercise performed only through an administrative console may tell you little about application behavior.
Use two synthetic tenants
An original verification fixture has one row for tenant A and one for tenant B. Through the real application role, attempt the intended read and write operations for each tenant context and compare the visible rows and accepted changes with a written expectation. Check insertion separately from selecting existing data.
Run an administrative query only as a control showing that both fixture rows exist. Label that result clearly; it is not the isolation test. If a connection pool carries tenant context, include successive requests for different tenants on a reused connection.
State the coverage
Our review record includes enabled policies, applicable roles, allowed operations and the mechanism that supplies tenant context. Row policies do not cover every table operation; PostgreSQL specifically excludes operations such as TRUNCATE from this mechanism. Keep schema administration and application data access in the same permission inventory, with separate explanations of the controls that govern them.