🗄️Blocked by security rules (RLS), so it won't save
new row violates row-level security policy for table "posts"
The database's row security rules (especially in Supabase) didn't allow this save or edit.
🤔 Why does it happen?
- RLS was turned on for the table, but no rules (policies) for "who can write" were made
- It tried to save without login info
🔧 Try this
- Add the rules you need in Supabase → the table → Policies
- Avoid turning RLS off, since that's risky
🤖 Ask your AI like this
I get 'violates row-level security policy' when saving to Supabase. Please don't turn RLS off; create policies so logged-in people can only write and read their own data. [Paste the full error here]
Replace the [ ] parts with your own situation, and paste the error with a few extra lines before and after it.
Related terms
Other errors in this group
- Database connection failed
Can't reach database server - Table doesn't exist
relation "…" does not exist - Login address mismatch (redirect_uri_mismatch)
Error 400: redirect_uri_mismatch - Tried to save a value that already exists (duplicate)
duplicate key value violates unique constraint - Login info has expired (JWT)
JWT expired - Login app info is wrong (invalid_client)
Error 401: invalid_client - Google login blocked (app not verified, testing mode)
Access blocked: app has not completed the Google verification process - Prisma isn't ready (prisma generate)
@prisma/client did not initialize yet. Please run "prisma generate"