← The Postgres Guy
/
RLS Policy Builder
Policy
Reset
Table name
Table options
Enable RLS on this table
Force RLS
(applies to table owner too)
Policy name
Type
Permissive policies are ORed together; Restrictive policies are ANDed
Permissive
Restrictive
Command
ALL
SELECT
INSERT
UPDATE
DELETE
Role
who this policy applies to
Common patterns
User owns row
Rows belong to the authenticated user
Apply →
Supabase auth
Uses Supabase auth.uid()
Apply →
Tenant isolation
Multi-tenant row isolation via session variable
Apply →
Admin only
Only the admin role can access rows
Apply →
Public read
Anyone can read, nobody can write
Apply →
USING expression
filter for existing rows
WITH CHECK expression
filter for new/updated rows
DDL
Fill in the form to generate your policy