Closed lauri865 closed 2 weeks ago
Hi @lauri865, there is indeed a version bump for plv8 on the platform side since 15.6.1.120. You can update your local setup by running supabase stop --no-backup
before supabase start
. Hope it helps.
All would be well and good, but the way I got stuck in this situation was different.
I was setting up a new cloud project (from an existing local project):
I'm not sure what the learning here is for either party, but I lost hours of productivity, because of an innocent supabase stop / supabase start sequence.
Sure, there's many other coincidences here, but maybe suggestions would be:
supabase link
is used for many things, so it might not be obvious that a command I ran a week ago will trigger an update sequence later.Yup agree that checking the versions into git would be nice going forward https://github.com/supabase/cli/issues/2435
We will probably add a flag other commands to specify different remotes. That would reduce the reliance on repeatedly running supabase link to activate different projects.
Great!
Seems like Supabase cloud prevents postgres upgrade when plv8 version changes, which is great. But it only says to disable plv8 in order to upgrade the postgres version, without offering any other instructions or why this needs to be done – confusing. And disabling plv8 is far from being a straightfoward thing to do if you're actually using it.
It can make for a very difficult upgrade path, if there's a deep dependency tree on plv8. Do we need to recreate the whole database was my first instinct?! In that case, we're gonna be stuck on this version for a while, because that's a pain to do manually.
I still think minor version upgrades of plv8 could be handled better, as they don't ship any breaking updates, but tearing down and rebuilding the database is a lot of work.
Luckily, I found a simpler workaround for the time being
CREATE OR REPLACE FUNCTION has_access()
RETURNS BOOLEAN
IMMUTABLE
AS $$
BEGIN
RAISE EXCEPTION 'database maintenance in progress';
RETURN false;
END
$$ LANGUAGE plpgsql;
DROP EXTENSION plv8;
, without having any cascading effectsCREATE EXTENSION plv8;
No need to mess with tearing down the whole database in our case – a few minutes work instead of hours of pain that we'd rather not take on. In our case, we only have 2 plv8 functions, but every RLS rule depends on them, and some views. So, cascading effects are very real.
@pcnc – does the below PR fix the above issue in the future? https://github.com/supabase/postgres/pull/1259
If so, I think there's more documentation / information needed to share with developer, as many of your customers may be stuck on older versions because of the cumbersome upgrade path.
Describe the bug Updated project link: postgres updated to
15.6.1.127
locallyGetting errors on every plv8 function:
Downgraded to: 15.6.1.120
Everything works again.
Any idea what we could do to solve this? We also tried v15.6.1.139, but it didn't work either.