]> granicus.if.org Git - postgis/commitdiff
Don't drop st_union when updating postgis extension to 2.4
authorRegina Obe <lr@pcorp.us>
Wed, 30 Aug 2017 00:25:02 +0000 (00:25 +0000)
committerRegina Obe <lr@pcorp.us>
Wed, 30 Aug 2017 00:25:02 +0000 (00:25 +0000)
Closes #3821 for PostGIS 2.4.0

git-svn-id: http://svn.osgeo.org/postgis/trunk@15609 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/postgis.sql.in
postgis/postgis_drop_after.sql

index 9a7464b8709042a49e98d3306c9a153a0c66a635..30fa89e78e015f69acfb415b2160ac1b46a32865 100644 (file)
@@ -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) (
index 9338b19c7f4fe9637ed990c11d3d370e45da08d9..407a7eb0dc5efb6a49c3999e963252e12cdf9dd0 100644 (file)
@@ -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;
+$$;