VibeFix

Video

new row violates row-level security policy

new row violates row-level security policy for table "profiles". Your data won't save.

Video transcript

new row violates row-level security policy for table "profiles". Your data won't save. It means row-level security is on and no policy lets this person write this row. Causes include a missing INSERT policy, a row without the signed-in user's id, or a person who is not signed in. Step 1. Look at the policies on the table in the Supabase dashboard. Add an insert policy that checks the row belongs to the signed-in user. Step 2. In the code that saves, set user id to the id of the signed-in user. Step 3. Require sign-in before the screen that saves, or wait until the session exists. To check: on your live address, sign up as a brand-new account and save a first row. The main catch: switching row-level security off hides the error and opens the table to anyone. The fix is the missing policy. VibeFix (vibe-fixer.com): free check first.

Read the full guide: "New row violates row-level security policy" fix

All videos