- Symptom
- { data: [], error: null } for a table that has data in the Table EditorSame query returns rows with the service role key or in the SQL editorWorks after disabling RLS on the table
- Cause
- With RLS enabled and no policy that matches the caller's role, Postgres filters every row out instead of raising an error. A missing user session makes the request run as anon, which policies for authenticated never match.
- Fix
- Add a SELECT policy for the role that actually makes the call, and confirm a user JWT is attached at call time by checking auth.jwt() through an RPC.
- Apply
create policy "read own rows" on public.todos for select to authenticated using ((select auth.uid()) = user_id);- Affected
- All Supabase projects with RLS enabled on the queried table, which the dashboard enables by default for new tables
- Sources
Last verified 2026-10-15 · Confirmed by 0 builders