Supabase · api · fg-0204

Supabase select returns an empty array with no error even though the table has rows

If you see { data: [], error: null } for a table that has data in the Table Editor, the cause and the fix for Supabase are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
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

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun