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
publiccreated after the change without a GRANT return Postgres error42501,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
authandstorageschemas, 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;
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:
- Paste one or more migration files.
- It lists new
publictables that are missing a GRANT forauthenticatedorservice_role(it also subtracts any later REVOKE in the paste). - 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)