← All errors · Supabase
Supabase select returns an empty array (no error)
Exact error
{ data: [], error: null }What it means
With RLS enabled and no SELECT policy matching the user, Postgres silently filters out all rows. No error is raised.
Likely causes
- RLS enabled with no SELECT policy.
- Policy restricts to authenticated but the request is anonymous.
- Querying the wrong schema or table name.
How to fix it
Add a select policy:
create policy "Users can read their own todos" on public.todos for select to authenticated using ( (select auth.uid()) = user_id );For public data, allow anon reads explicitly:
create policy "Public read" on public.posts for select to anon, authenticated using ( true );Test in the SQL editor's role switcher, or check the user session in the client.
Related errors
Get new fixes weekly
No spam. Unsubscribe anytime. Privacy