]> granicus.if.org Git - postgis/commitdiff
Upgrade during create extension from unpackaged
authorSandro Santilli <strk@kbt.io>
Thu, 26 Oct 2017 06:46:50 +0000 (06:46 +0000)
committerSandro Santilli <strk@kbt.io>
Thu, 26 Oct 2017 06:46:50 +0000 (06:46 +0000)
This commit does it for "postgis" and "postgis_topology"
extensions.

Closes #3913

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

.gitignore
NEWS
extensions/postgis/Makefile.in
extensions/postgis/unpackaged_check.sql.in [deleted file]
extensions/postgis_topology/Makefile.in
extensions/postgis_topology/unpackaged_check.sql.in [deleted file]

index 471486a138a0bcbdbe952402597f470b9917a1d1..984552aacc31461fce74af1d6a631d80252c5b63 100644 (file)
@@ -48,7 +48,6 @@ extensions/address_standardizer/results/
 extensions/address_standardizer/us-*.sql
 extensions/postgis/Makefile
 extensions/postgis/postgis.control
-extensions/postgis/unpackaged_check.sql
 extensions/postgis/sql/
 extensions/postgis/sql_bits/*.sql
 extensions/postgis_sfcgal/Makefile
@@ -65,7 +64,6 @@ extensions/postgis_tiger_geocoder/sql_bits/tiger_geocoder.sql.in
 extensions/postgis_tiger_geocoder/sql_bits/tiger_geocoder_minor.sql.in
 extensions/postgis_topology/Makefile
 extensions/postgis_topology/postgis_topology.control
-extensions/postgis_topology/unpackaged_check.sql
 extensions/postgis_topology/sql/
 extensions/postgis_topology/sql_bits/*.sql
 GNUmakefile
diff --git a/NEWS b/NEWS
index 4b7304710b743343166f5720fd61ed24a280c400..93da6737378f67c20cf9a387d3fd4c21685ae2a1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@ PostGIS 2.5.0
   - #3876, ST_Angle function (RĂ©mi Cura)
   - #3564, ST_LineInterpolatePoints (Dan Baston)
   - #3896, PostGIS_Extensions_Upgrade()
+  - #3913, Upgrade when creating extension from unpackaged (Sandro Santilli)
 
 * Breaking Changes *
   - #3885, version number removed from address_standardize lib file
@@ -20,8 +21,6 @@ PostGIS 2.5.0
   - TopoGeo_addLinestring robustness improvements (Sandro Santilli)
     #1855, #1946, #3718, #3838
   - #3234, Do not accept EMPTY points as topology nodes (Sandro Santilli)
-  - #3892, Prevent version mixup when creating extension from unpackaged
-           (Sandro Santilli)
   - #1014, Hashable geometry, allowing direct use in CTE signatures (Paul Ramsey)
 
 
index e6e00d95da48433963cbcbfcfd666d36a0a7c134..6fb1456a2054e6a6f1bec9b4e9a8d3074006c03f 100644 (file)
@@ -79,9 +79,9 @@ $(EXTENSION).control: $(EXTENSION).control.in Makefile
 sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).sql | sql
        cp $< $@
 
-sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: $(EXTENSION_UNPACKAGED_UPGRADE_SCRIPTS) ../../utils/create_unpackaged.pl unpackaged_check.sql Makefile | sql
+sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: $(EXTENSION_UNPACKAGED_UPGRADE_SCRIPTS) sql/$(EXTENSION)--ANY--$(EXTVERSION).sql ../../utils/create_unpackaged.pl Makefile | sql
        # Ensure version is correct
-       cat unpackaged_check.sql > $@
+       cat sql/$(EXTENSION)--ANY--$(EXTVERSION).sql > $@
        cat $(EXTENSION_UNPACKAGED_UPGRADE_SCRIPTS) \
                | $(PERL) ../../utils/create_unpackaged.pl postgis \
                >> $@
diff --git a/extensions/postgis/unpackaged_check.sql.in b/extensions/postgis/unpackaged_check.sql.in
deleted file mode 100644 (file)
index 19152f6..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-DO $$
-DECLARE
-       ver TEXT;
-BEGIN
-       ver := split_part(postgis_scripts_installed(), ' ', 1);
-       IF ver != '@EXTVERSION@' THEN
-               RAISE EXCEPTION 'Installed PostGIS version is %', ver
-               USING HINT = 'Try `CREATE EXTENSION postgis VERSION '''
-                       || ver || ''' from unpackaged`,'
-                       ' or source postgis_upgrade.sql`';
-       END IF;
-END;
-$$ LANGUAGE 'plpgsql';
-
index 2c234852b2ea56ed11cf9cc37cd9b207ed4dd060..3e1e1dc89de8788deb10dad1d7b02cc8f9d96b1c 100644 (file)
@@ -60,17 +60,12 @@ sql_bits/topology.sql: ../../topology/topology.sql
 sql_bits/topology_comments.sql: ../../doc/topology_comments.sql
        cp $< $@
 
-sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: ../../topology/topology.sql ../../utils/create_unpackaged.pl unpackaged_check.sql Makefile
+sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: ../../topology/topology.sql ../../utils/create_unpackaged.pl sql/$(EXTENSION)--ANY--$(EXTVERSION).sql Makefile
        mkdir -p sql
-       # Ensure version is correct
-       cat unpackaged_check.sql > $@
+       # Ugprade before packaging
+       cat sql/$(EXTENSION)--ANY--$(EXTVERSION).sql > $@
        cat $< | $(PERL) ../../utils/create_unpackaged.pl postgis_topology >> $@
 
-unpackaged_check.sql: unpackaged_check.sql.in Makefile
-       cat $< \
-               | sed -e 's|@EXTVERSION@|$(EXTVERSION)|g' \
-               > $@
-
 #upgrade script should have everything but table, schema, type creation/alter
 #NOTE: we assume all object definitions end in ;
 #first expression deletes all non-removable objects defined on same line
diff --git a/extensions/postgis_topology/unpackaged_check.sql.in b/extensions/postgis_topology/unpackaged_check.sql.in
deleted file mode 100644 (file)
index 8b89498..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-DO $$
-DECLARE
-       ver TEXT;
-BEGIN
-       ver := split_part(postgis_topology_scripts_installed(), ' ', 1);
-       IF ver != '@EXTVERSION@' THEN
-               RAISE EXCEPTION 'Installed PostGIS Topology version is %', ver
-               USING HINT = 'Try `CREATE EXTENSION postgis_topology VERSION '''
-                       || ver || ''' from unpackaged`,'
-                       ' or source topology_upgrade.sql`';
-       END IF;
-END;
-$$ LANGUAGE 'plpgsql';
-