Category: Supabase and databases

Supabase: INSERT Succeeds but SELECT Returns No Rows

Read this guide in Polish

The form saves the record without error, then the user sees an empty table.

Why is this happening?

INSERT and SELECT policies are independent operations. You may have the right to create a record, but not the right to read it later.

Step by step solution

1. Confirm the existence of a poem in the controller's controlled panel, not on the basis of a toast message.

2 . Check RLS settings and separate policies for INSERT and SELECT.

3 . Compare the user's uid with the owner id value recorded in the record.

4 . In tests, perform queries with token of the actual role, not with the service key.

5 . After changing policies, check refresh, visibility and lack of access to other people's records.

How do I check the score?

The record author sees it after saving and after new login, another user sees it only when the permission model allows it.

Do not disable RLS on production as a permanent override of the problem.