Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ begin;
create role supabase_tmp superuser;
set session authorization supabase_tmp;

do $$
begin
if exists (select from pg_extension where extname = 'timescaledb') then
execute(format('select %I.timescaledb_pre_restore()', (select pronamespace::regnamespace from pg_proc where proname = 'timescaledb_pre_restore')));
end if;
end
$$;

do $$
declare
postgres_rolpassword text := (select rolpassword from pg_authid where rolname = 'postgres');
Expand Down Expand Up @@ -493,6 +501,14 @@ begin
end
$$;

do $$
begin
if exists (select from pg_extension where extname = 'timescaledb') then
execute(format('select %I.timescaledb_post_restore()', (select pronamespace::regnamespace from pg_proc where proname = 'timescaledb_post_restore')));
end if;
end
$$;

set session authorization supabase_admin;
drop role supabase_tmp;
commit;
Expand Down
Loading