DEV Community

FixLoop
FixLoop

Posted on Originally published at fixloop.dev

Free tool: find Supabase tables that will 42501 after Oct 30

On October 30, 2026, existing Supabase projects stop auto-granting privileges on new tables in the public schema. Source: Supabase changelog.

What that means in practice:

  • Existing tables are not affected. They keep their current grants and stay reachable.
  • New tables in public created after the change without a GRANT return Postgres error 42501, permission denied for table, through the Data API (supabase-js, REST, GraphQL). RLS policies don't help, because Postgres checks grants before RLS.
  • Direct Postgres connections, and the auth and storage schemas, are not part of this change.

The fix, if you just want the SQL

Put the grants in the same migration as the table and its policies, least privilege:

alter table public.your_table enable row level security;
grant select, insert, update, delete on table public.your_table to authenticated;
grant select, insert, update, delete on table public.your_table to service_role;
-- only if signed-out visitors should read it:
-- grant select on table public.your_table to anon;
Enter fullscreen mode Exit fullscreen mode

Skip grant all on all tables in schema public. That also opens tables where RLS was never turned on.

The checker

If you have a pile of migrations (or Lovable keeps writing new ones), I built a free page that does the tedious part:

Supabase grants checker

  1. Paste one or more migration files.
  2. It lists new public tables that are missing a GRANT for authenticated or service_role (it also subtracts any later REVOKE in the paste).
  3. Copy the GRANT statements it writes.

It runs entirely in your browser. The SQL is never sent anywhere, and there's no signup. Comments and string literals are ignored, and tables in auth, storage or other schemas are skipped.

Tell your AI builder

Lovable and other AI builders learned the old default: create table, enable RLS, add policies, done. Add this to your project instructions:

When you create a Supabase table, put CREATE TABLE, ENABLE ROW LEVEL SECURITY, the policies and explicit GRANTs to authenticated and service_role in the same migration. Grant to anon only if signed-out users should read it. Never use GRANT ALL.

Full walkthrough: Supabase Oct 30 grants change: fix 42501 on new tables.

Still stuck on a 42501 (or anything else in a Lovable/Supabase app)? Paste the error and get a free diagnosis within 24 hours.

Top comments (0)