Row-Level Security

ALTER TABLE ... DISABLE ROW LEVEL SECURITY

Lock mode ACCESS EXCLUSIVE
Risk HIGH
Blocks reads, writes, other DDL
pgfence rule disable-rls
ALTER TABLE orders DISABLE ROW LEVEL SECURITY;

What this does

Silently exposes every row that policies were previously hiding to any role with table-level SELECT. This is a data-exposure risk disguised as a routine ALTER TABLE.

Safe rewrite

Audit which roles and rows are affected before disabling, fix the policies instead if that is the real problem

-- Audit before disabling:
SELECT polname, polcmd, polqual FROM pg_policy WHERE polrelid = 'orders'::regclass;
-- Only then:
ALTER TABLE orders DISABLE ROW LEVEL SECURITY;

Read more

More in Row-Level Security