May 2019
Intermediate to advanced
600 pages
20h 46m
English
RLS policies are created and dropped on a given table using the CREATE POLICY syntax. The RLS policy itself must also be enabled explicitly on the given table, because it is disabled by default.
In the previous example, we needed to grant privileges on the table or on the columns, in addition to creating the RLS policy. This is because RLS is not one more privilege to be added to the other; rather, it works like an additional check. In this sense, it is convenient that it is off by default, as we have to create policies only on the tables where our access logic depends on the row contents.
Read now
Unlock full access