Skip to content

Commit

Permalink
PG17 compatibility: fix pg16 to pg17 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
colm-mchugh committed Dec 13, 2024
1 parent 1c39f95 commit b37b114
Show file tree
Hide file tree
Showing 3 changed files with 579 additions and 430 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ BEGIN
DROP AGGREGATE IF EXISTS array_cat_agg(anyarray);
DROP AGGREGATE IF EXISTS array_cat_agg(anycompatiblearray);

-- We should drop any_value because PG16 has its own any_value function
-- We should drop any_value because PG16+ has its own any_value function
-- We can remove this part when we drop support for PG16
DELETE FROM pg_depend WHERE
objid IN (SELECT oid FROM pg_proc WHERE proname = 'any_value' OR proname = 'any_value_agg') AND
refobjid IN (select oid from pg_extension where extname = 'citus');
DROP AGGREGATE IF EXISTS pg_catalog.any_value(anyelement);
DROP FUNCTION IF EXISTS pg_catalog.any_value_agg(anyelement, anyelement);
IF substring(current_Setting('server_version'), '\d+')::int < 16 THEN
DELETE FROM pg_depend WHERE
objid IN (SELECT oid FROM pg_proc WHERE proname = 'any_value' OR proname = 'any_value_agg') AND
refobjid IN (select oid from pg_extension where extname = 'citus');
DROP AGGREGATE IF EXISTS pg_catalog.any_value(anyelement);
DROP FUNCTION IF EXISTS pg_catalog.any_value_agg(anyelement, anyelement);
END IF;

--
-- Drop existing backup tables
Expand Down
Loading

0 comments on commit b37b114

Please sign in to comment.