From: Regina Obe Date: Wed, 30 Aug 2017 00:25:02 +0000 (+0000) Subject: Don't drop st_union when updating postgis extension to 2.4 X-Git-Tag: 2.4.0beta1~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=19444fb3f76cf7b07425facd85f67ae20b4243e5;p=postgis Don't drop st_union when updating postgis extension to 2.4 Closes #3821 for PostGIS 2.4.0 git-svn-id: http://svn.osgeo.org/postgis/trunk@15609 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in index 9a7464b87..30fa89e78 100644 --- a/postgis/postgis.sql.in +++ b/postgis/postgis.sql.in @@ -3866,7 +3866,9 @@ CREATE OR REPLACE FUNCTION ST_Union (geometry[]) LANGUAGE 'c' IMMUTABLE STRICT _PARALLEL; -- Availability: 1.2.2 --- Changed: 2.4.0 marked parallel safe +-- Changed but upgrader helper no touch: 2.4.0 marked parallel safe +-- we don't want to force drop of this agg since its often used in views +-- parallel handling dealt with in postgis_drop_after.sql CREATE AGGREGATE ST_Union (geometry) ( sfunc = pgis_geometry_accum_transfn, stype = pgis_abs, @@ -3876,6 +3878,7 @@ CREATE AGGREGATE ST_Union (geometry) ( finalfunc = pgis_geometry_union_finalfn ); + -- Availability: 1.2.2 -- Changed: 2.4.0: marked parallel safe CREATE AGGREGATE ST_Collect (geometry) ( diff --git a/postgis/postgis_drop_after.sql b/postgis/postgis_drop_after.sql index 9338b19c7..407a7eb0d 100644 --- a/postgis/postgis_drop_after.sql +++ b/postgis/postgis_drop_after.sql @@ -170,3 +170,14 @@ DROP FUNCTION IF EXISTS geometry_distance_box_nd(geometry,geometry); -- temporar -- pgis_abs type was increased from 8 bytes in 2.1 to 16 bytes in 2.2 -- See #3460 UPDATE pg_type SET typlen=16 WHERE typname='pgis_abs' AND typlen=8; + +DO language 'plpgsql' +$$ +BEGIN +IF _postgis_scripts_pgsql_version()::integer >= 96 THEN +-- mark ST_Union agg as parallel safe if it is not already + UPDATE pg_proc SET proparallel = 's' + WHERE oid = 'st_union(geometry)'::regprocedure AND proparallel = 'u'; +END IF; +END; +$$;