[postgis-tickets] r16754 - Add postgis_raster support in postgis_extensions_upgrade()
Sandro Santilli
strk at kbt.io
Tue Sep 11 02:20:37 PDT 2018
Author: strk
Date: 2018-09-11 02:20:37 -0700 (Tue, 11 Sep 2018)
New Revision: 16754
Modified:
trunk/doc/reference_management.xml
trunk/postgis/postgis.sql.in
Log:
Add postgis_raster support in postgis_extensions_upgrade()
Modified: trunk/doc/reference_management.xml
===================================================================
--- trunk/doc/reference_management.xml 2018-09-11 09:20:32 UTC (rev 16753)
+++ trunk/doc/reference_management.xml 2018-09-11 09:20:37 UTC (rev 16754)
@@ -370,9 +370,13 @@
to latest installed version. Only extensions you have installed in the database will be upgraded and if they are already at last installed version,
they will not be upgraded. Reports full postgis version and build configuration
infos after. This is short-hand for doing multiple ALTER EXTENSION .. UPDATE for each postgis extension.
- Currently only tries to upgrade extensions postgis, postgis_sfcgal, postgis_topology, and postgis_tiger_geocoder.</para>
+ Currently only tries to upgrade extensions postgis,
+ postgis_raster, postgis_sfcgal, postgis_topology, and postgis_tiger_geocoder.</para>
<para>Availability: 2.5.0</para>
+ <note>
+ <para>Changed: 3.0.0 to support separate postgis_raster extension</para>
+ </note>
</refsection>
<refsection>
@@ -381,9 +385,7 @@
<programlisting>SELECT PostGIS_Extensions_Upgrade();</programlisting>
<screen>
NOTICE: ALTER EXTENSION postgis_tiger_geocoder UPDATE TO "2.5.0dev";
-CONTEXT: PL/pgSQL function postgis_extensions_upgrade() line 10 at RAISE
NOTICE: ALTER EXTENSION postgis_topology UPDATE TO "2.5.0dev";
-CONTEXT: PL/pgSQL function postgis_extensions_upgrade() line 10 at RAISE
postgis_extensions_upgrade
----------------------------------------------------------------------------------
Modified: trunk/postgis/postgis.sql.in
===================================================================
--- trunk/postgis/postgis.sql.in 2018-09-11 09:20:32 UTC (rev 16753)
+++ trunk/postgis/postgis.sql.in 2018-09-11 09:20:37 UTC (rev 16754)
@@ -2813,6 +2813,7 @@
$$ LANGUAGE 'sql' STABLE;
-- Availability: 2.5.0
+-- Changed: 3.0.0 also upgrade postgis_raster if it exists
CREATE OR REPLACE FUNCTION postgis_extensions_upgrade() RETURNS text
AS $$
DECLARE rec record; sql text;
@@ -2822,9 +2823,17 @@
FOR rec in SELECT name, default_version, installed_version
FROM pg_available_extensions
- WHERE installed_version > '' AND name IN('postgis', 'postgis_sfcgal', 'postgis_tiger_geocoder', 'postgis_topology')
+ WHERE installed_version > '' AND name IN(
+ 'postgis',
+ 'postgis_raster',
+ 'postgis_sfcgal',
+ 'postgis_tiger_geocoder',
+ 'postgis_topology')
AND ( default_version <> installed_version OR
- ( default_version = installed_version AND default_version ILIKE '%dev%' AND installed_version ILIKE '%dev%' ) ) LOOP
+ ( default_version = installed_version AND
+ default_version ILIKE '%dev%' AND
+ installed_version ILIKE '%dev%' ) )
+ LOOP
-- we need to upgrade to next so our installed is different from current
-- and then we can upgrade to default_version
More information about the postgis-tickets
mailing list