]> granicus.if.org Git - postgis/commitdiff
postgis_extensions_upgrade() also updates after pg_upgrade
authorRaúl Marín Rodríguez <rmrodriguez@carto.com>
Mon, 22 Jul 2019 13:27:46 +0000 (13:27 +0000)
committerRaúl Marín Rodríguez <rmrodriguez@carto.com>
Mon, 22 Jul 2019 13:27:46 +0000 (13:27 +0000)
Closes #4271
Closes https://github.com/postgis/postgis/pull/449

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

NEWS
postgis/postgis.sql.in

diff --git a/NEWS b/NEWS
index 207bab2a3204c77c37c66a9425cc105211007a5c..e5fa78e1814a044b535c635b0ac0ac683f5b937a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,7 @@ Additional features enabled if you are running Proj6+ and PostgreSQL 12
   - #4456, add Rasbery Pi 32-bit jenkins bot for testing (Bruce Rindahl)
   - #4454, Speed up _ST_OrderingEquals (Raúl Marín)
   - #4453, Speed up ST_IsEmpty (Raúl Marín)
+  - #4271, postgis_extensions_upgrade() also updates after pg_upgrade (Raúl Marín)
 
 PostGIS 3.0.0alpha3
 2019/07/01
index 57bc5f2de3e656cd0043095a0edbb0ac787e0d2d..0a474b17af5baaabba1744457fd085d595013eed 100644 (file)
@@ -2854,11 +2854,11 @@ BEGIN
                                rec.name, rec.installed_version, rec.default_version;
                        RAISE DEBUG '%', sql;
                        EXECUTE sql;
-               ELSIF rec.default_version = rec.installed_version AND
-                                       rec.installed_version ILIKE '%dev'
+               ELSIF (rec.default_version = rec.installed_version AND rec.installed_version ILIKE '%dev') OR
+                       (@extschema@._postgis_pgsql_version() != @extschema@._postgis_scripts_pgsql_version())
                THEN
                        -- we need to upgrade to next and back
-                       RAISE NOTICE 'Updating dev extension % %',
+                       RAISE NOTICE 'Updating extension % %',
                                rec.name, rec.installed_version;
                        sql = 'ALTER EXTENSION ' || rec.name || ' UPDATE TO ' ||
                                                quote_ident(rec.default_version || 'next')   || ';';