moddatetime failing to install extension on `supabase db reset`?
Get this every time I run a migration in one project but not the other?
ERROR: permission denied for function pg_read_file (SQLSTATE 42501)
At statement: 1
create extension if not exists moddatetime schema extensions
4 Replies
A similar query seems to have happened to this user on stack exchange and it looks like upgrading the database solved the problem for them https://stackoverflow.com/questions/79512759/supabase-error-permission-denied-to-create-extension-moddatetime
Stack Overflow
Supabase error: permission denied to create extension "moddatetime"
While trying to create a local supabase dev environment,
supabase start
is failing with
Seeding globals from roles.sql...
Applying migration 20250315203000_remote_schema.sql...
Stopping containers...
You can do this easily - enable the moddatetime extension manually from the Supabase Dashboard > Database > Extensions, or run this once in the SQL editor as the admin:
CREATE EXTENSION IF NOT EXISTS moddatetime SCHEMA extensions;Every time I run supabase db reset this gets wiped out, or should it not?
I have that extension enabed by my migrations with any issue. What version of the CLI are you using? and what version of Postgres is your project on?
Ok I just ran into this issue with my migration to a new project just now. Something might be broken with how migrations work.
So it turns out the extension is already installed it seems but now you have to specify the schema name before the extension name when referencing it. In my case I had to change
to