Row-Level Security (RLS)
Row-level security (RLS) is a PostgreSQL feature that restricts which rows a user can read or modify using policies enforced by the database on every query.
With RLS, you attach policies to a table. Each policy is a SQL expression that decides which rows are visible or writable for the current user. Once enabled, PostgreSQL applies it automatically to every query.
RLS is the foundation of secure multi-tenancy and per-user access. A single policy keyed on a tenant or owner column guarantees isolation no matter which client — API, SQL console, or background job — runs the query.
Because the rule lives in the database, you define access control once instead of re-checking it in every endpoint, eliminating a whole class of data-leak bugs.
Related terms
Row-Level Security in Kolaybase
See it in practice
Kolaybase gives you PostgreSQL, auth, storage, and a REST API in minutes.