From: Raúl Marín Rodríguez Date: Mon, 22 Jul 2019 13:27:46 +0000 (+0000) Subject: postgis_extensions_upgrade() also updates after pg_upgrade X-Git-Tag: 3.0.0alpha4~42 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=88a312f60d2e00e0e803b7f63c2d8a78c5f83169;p=postgis postgis_extensions_upgrade() also updates after pg_upgrade 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 --- diff --git a/NEWS b/NEWS index 207bab2a3..e5fa78e18 100644 --- 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 diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in index 57bc5f2de..0a474b17a 100644 --- a/postgis/postgis.sql.in +++ b/postgis/postgis.sql.in @@ -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') || ';';