Row-Level Security
ALTER TABLE ... FORCE ROW LEVEL SECURITY
ALTER TABLE orders FORCE ROW LEVEL SECURITY; What this does
Makes the table owner subject to its own RLS policies too. If no policy covers the owner-backed access path (a common assumption for maintenance jobs and admin tooling), those flows silently stop seeing or changing rows.
Safe rewrite
Audit owner-backed access before forcing RLS, then test as the owner role
-- Audit policies and owner-backed access first
SELECT polname, polcmd, polqual FROM pg_policy WHERE polrelid = 'orders'::regclass;
ALTER TABLE orders FORCE ROW LEVEL SECURITY;
SET ROLE owner_or_app_role; SELECT count(*) FROM orders;