From dea29c650de24bdb6423a710eb185ccc5dedfa9e Mon Sep 17 00:00:00 2001 From: "Michael J. Sullivan" Date: Fri, 20 Dec 2024 11:47:26 -0800 Subject: [PATCH] Fix SQL introspection after inplace upgrade We need to refresh the views after the upgrade. Fixes #8155. --- edb/server/inplace_upgrade.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/edb/server/inplace_upgrade.py b/edb/server/inplace_upgrade.py index d07ca92bee64..86b9c4551b26 100644 --- a/edb/server/inplace_upgrade.py +++ b/edb/server/inplace_upgrade.py @@ -57,6 +57,7 @@ from edb.pgsql import common as pg_common from edb.pgsql import dbops +from edb.pgsql import metaschema from edb.pgsql import trampoline @@ -273,6 +274,15 @@ async def _upgrade_one( except Exception: raise + # Refresh the pg_catalog materialized views + current_block = dbops.PLTopBlock() + refresh = metaschema.generate_sql_information_schema_refresh( + backend_params.instance_params.version + ) + refresh.generate(current_block) + patch = current_block.to_string() + await ctx.conn.sql_execute(patch.encode('utf-8')) + new_local_spec = config.load_spec_from_schema( schema, only_exts=True,