Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CREATE ACCESS POLICY

Creates a row-level access policy for a relation.

CREATE ACCESS POLICY policy_name
ON schema_name.table_name
USING (tenant_id = current_setting('app.tenant_id'));

The USING expression is evaluated for rows visible to the current role. Keep policies deterministic and test both matching and non-matching rows. Policy syntax and enforcement are still an initial implementation; unsupported expressions are rejected during binding.