Skip to content

Commit 03537ce

Browse files
authored
fix: run timescaledb_pre/post_restore() (#1197)
1 parent e6de880 commit 03537ce

File tree

1 file changed

+16
-0
lines changed
  • ansible/files/admin_api_scripts/pg_upgrade_scripts

1 file changed

+16
-0
lines changed

ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,14 @@ begin;
9393
create role supabase_tmp superuser;
9494
set session authorization supabase_tmp;
9595
96+
do $$
97+
begin
98+
if exists (select from pg_extension where extname = 'timescaledb') then
99+
execute(format('select %I.timescaledb_pre_restore()', (select pronamespace::regnamespace from pg_proc where proname = 'timescaledb_pre_restore')));
100+
end if;
101+
end
102+
$$;
103+
96104
do $$
97105
declare
98106
postgres_rolpassword text := (select rolpassword from pg_authid where rolname = 'postgres');
@@ -493,6 +501,14 @@ begin
493501
end
494502
$$;
495503
504+
do $$
505+
begin
506+
if exists (select from pg_extension where extname = 'timescaledb') then
507+
execute(format('select %I.timescaledb_post_restore()', (select pronamespace::regnamespace from pg_proc where proname = 'timescaledb_post_restore')));
508+
end if;
509+
end
510+
$$;
511+
496512
set session authorization supabase_admin;
497513
drop role supabase_tmp;
498514
commit;

0 commit comments

Comments
 (0)