Supabase · api · fg-0204
Supabase select returns an empty array with no error even though the table has rows
{ data: [], error: null } for a table that has data in the Table Editor
Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100
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);
Affects: All Supabase projects with RLS enabled on the queried table, which the dashboard enables by default for new tables
Sources
- https://supabase.com/docs/guides/troubleshooting/why-is-my-select-returning-an-empty-data-array-and-i-have-data-in-the-table-xvOPgx
- https://supabase.com/docs/guides/database/postgres/row-level-security
Have your agent know this before it fails
claude mcp add --transport http footgun https://getfootgun.com/api/mcp