VibeFix

FREE TOOL

Supabase 42501 GRANT SQL generator: make the GRANT for your table

Updated

Do not fix it with a bare grant select ... to anon on a table whose row level security is off: anyone with your publishable (anon) key could then read every row, and that key is in your app’s front end. Sources: Supabase changelog and Supabase: 42501 errors. The full explanation is in our guide: Supabase “permission denied for table” (42501).

Type your table name, pick who needs access, and copy the SQL. Paste it into the Supabase SQL Editor and run it. It turns on row level security first, then adds the grants and Supabase’s example policy, filled in with your table name.

If your error says new row violates row-level security policy, that is a different problem: the grant is fine and a policy is blocking the row. See Data won’t save? Row level security.

Runs in your browser. The table name you type is not sent to us.

1. Your table

2. Who needs access

Roleselectinsertupdatedelete
anon
authenticated
service_role

The defaults match the example in Supabase’s changelog. Keep anon ticked only if signed-out visitors should be able to read the table. Supabase says to grant the minimum privileges each role needs (Securing your API).

3. Your SQL

  1. Open your project in the Supabase dashboard and open the SQL Editor.
  2. Paste the SQL, read it, and run it.
  3. Step 3 is Supabase’s example. It assumes your table has a user_id column. Change it to the policy your app needs. Supabase says to treat grant, RLS and policy as one unit (Supabase changelog).
  4. If your table has an auto-numbered column, Supabase says new sequences also need explicit grants. Read the changelog before you add them. This tool does not write sequence statements.

Check what you already have

Run this in the SQL Editor to see which roles can reach the table (Supabase: 42501 errors):

Which 42501 do you have?

Both errors carry code 42501. Read the message.

The RLS message text comes from a Supabase GitHub discussion, not from the documentation.

The full explanation is in our guide: Supabase “permission denied for table” (42501) after 30 Oct 2026.

Then test it as a stranger

Open your live app in a private window, sign up with a fresh email, and do the thing that was failing. If it works, the grant is in place.

VibeFix’s free check tries the problem you describe on your live app: tell us what broke, and our AI agent tries it and sends you a screenshot. If you want it fixed, it finds the cause, fixes it in your code and re-checks your live app. It does not look inside your Supabase project or read your grants. The free check does not change your app.

Want it fixed?

Our AI agent finds which cause is breaking your app, fixes it in your code and re-checks your live app. The price is on the pricing page. If we can’t complete your re-check, you get your money back. It starts with a free check that confirms the problem: Test my app — free.

FAQ

Why did 42501 start after 30 October 2026?
Supabase applied a change to all existing projects on 30 October 2026: new tables in the public schema are no longer reachable through the Data API until you grant access. Tables you already had keep their grants.

Will my old tables break?
No. Existing tables keep their current grants and stay reachable. Only tables created after the change need explicit grants.

Should I just run grant select to anon?
Only if signed-out visitors really need to read that table, and only with row level security turned on and a policy in place. With row level security off, the anon grant lets anyone with your publishable key read every row.

Is 42501 a row level security error?
It can be either. A missing grant gives 42501 before any policy runs. Row level security also returns 42501 when it blocks an insert or update. Check the grants first, then the policies.

Where can I see which tables are exposed?
The Data API exposure badge in the Table Editor of your Supabase dashboard shows which tables are exposed. Before 30 October the Security Advisor also flagged affected tables.

Is my table name sent to VibeFix?
No. The SQL is built in your browser by a script on this page.

This tool writes SQL from the statements Supabase published in its changelog. It does not connect to your project and cannot know what your app needs. Read the SQL before you run it, and compare it with Supabase’s current docs. Last checked: 1 November 2026.

VibeFix is independent. Supabase is a trademark of its owner.