Row Level Security
summary
Postgres adds native row‑level security in 9.5: enable it per table with ALTER TABLE ENABLE ROW LEVEL SECURITY, define per‑command policies with CREATE POLICY ... USING ... WITH CHECK (default deny, policies ORed, owners and superusers exempt unless you SET ROW SECURITY = FORCE), policies accept role lists, USING filters and WITH CHECK for inserts/updates, leakproof functions allow safe pushdown to indexes, no policy-on-views today, SELinux integration is proposed, and grant controls for policies are not yet implemented.
AI-written summary · about
chapters (17)
- 0:00Row Level Security intro
- 1:59Prior RLS approaches in PostgreSQL
- 10:55Multi-schema RLS challenges
- 11:17Native RLS in PostgreSQL
- 13:45Enabling/disabling RLS policies
- 15:28Creating RLS policies
- 22:51Multiple policies and role membership
- 25:18RLS with data modification
- 30:11RLS and query planning
- 34:18Functions in RLS policies
- 36:55RLS policy security
- 41:12Default deny and visibility
- 43:38Inserting invisible records
- 45:02RLS with external security
- 47:10Leak-proof functions and performance
- 48:36EXPLAIN RLS queries
- 51:03Future RLS enhancements
related talks
47mRow Level Security Explained
18mEverything you need to know about Postgres Row Level Security
28mHitchhiker's Guide to Row-Level Security in Citus
43mThe Role of Row Level Security in High-Load Projects
42mData Security using Roles, Privileges and Row Level Security
32mEnhancing Security in PostgreSQL
27mFor Your Eyes Only: Roles, Privileges, and Security in PostgreSQL
07mAll about Postgres security
