What effect does this policy have on queries?
-- PostgreSQL ALTER TABLE docs ENABLE ROW LEVEL SECURITY; CREATE POLICY own ON docs USING (owner = current_user);
- Users see only their own rows
- Only the owner can alter docs
- Docs are encrypted per user
- Each user gets a private copy
Row-level security adds the
Play SQL & Databases ▸
USING condition to every query, filtering rows per user (table owners bypass it by default).