[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0rc2-574-g33e4ee1e9

git at osgeo.org git at osgeo.org
Mon Jan 30 08:50:05 PST 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, master has been updated
       via  33e4ee1e92d9b48e169a53d2da34a851117e0363 (commit)
      from  9db2a5fb0cf2c5658c18973cc8084f827192e51f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 33e4ee1e92d9b48e169a53d2da34a851117e0363
Author: Sandro Santilli <strk at kbt.io>
Date:   Fri Jan 27 21:44:41 2023 +0100

    Add optional target_version argument to postgis_extensions_upgrade
    
    Include documentation update.
    
    Closes #5052

diff --git a/NEWS b/NEWS
index 2f2750c86..4cefab6bd 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@ xxxx/xx/xx
   - #5229, Drop support for Proj < 6.1 and PG 11 (Regina Obe)
 
 * New Features *
+  - #5052, target version support in postgis_extensions_upgrade
+    (Sandro Santilli)
   - #5306, expose version of GEOS at compile time (Sandro Santilli)
   - New install-extension-upgrades command in postgis script (Sandro Santilli)
   - #5257, #5261, #5277, Support changes for PostgreSQL 16 (Regina Obe)
diff --git a/doc/reference_version.xml b/doc/reference_version.xml
index f960dacd4..8171eb0c6 100644
--- a/doc/reference_version.xml
+++ b/doc/reference_version.xml
@@ -15,7 +15,7 @@
 
 		<refpurpose>
 Packages and upgrades PostGIS extensions (e.g. postgis_raster,
-postgis_topology, postgis_sfcgal) to latest available version.
+postgis_topology, postgis_sfcgal) to given or latest version.
     </refpurpose>
 	  </refnamediv>
 
@@ -23,8 +23,7 @@ postgis_topology, postgis_sfcgal) to latest available version.
 		<funcsynopsis>
 		  <funcprototype>
 			<funcdef>text <function>PostGIS_Extensions_Upgrade</function></funcdef>
-
-			<paramdef></paramdef>
+			<paramdef choice="opt"><type>text</type> <parameter>target_version=null</parameter></paramdef>
 		  </funcprototype>
 		</funcsynopsis>
 	  </refsynopsisdiv>
@@ -33,7 +32,7 @@ postgis_topology, postgis_sfcgal) to latest available version.
 		<title>Description</title>
 
 		<para>Packages and upgrades PostGIS extensions
-		to latest version. Only extensions you have installed in the
+		to given or latest version. Only extensions you have installed in the
     database will be packaged and upgraded if needed.
 		Reports full PostGIS version and build configuration infos after.
     This is short-hand for doing multiple CREATE EXTENSION .. FROM
@@ -43,6 +42,7 @@ postgis_topology, postgis_sfcgal) to latest available version.
 
 		<para>Availability: 2.5.0</para>
 		<note>
+			<para>Changed: 3.4.0 to add target_version argument.</para>
             <para>Changed: 3.3.0 support for upgrades from any PostGIS version. Does not work on all systems.</para>
 			<para>Changed: 3.0.0 to repackage loose extensions and support postgis_raster.</para>
 		</note>
diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in
index 1ba84b72b..ad4477760 100644
--- a/postgis/postgis.sql.in
+++ b/postgis/postgis.sql.in
@@ -3008,13 +3008,14 @@ $$ LANGUAGE 'sql' STABLE;
 -- Changed: 3.3.0 support for upgrades from any PostGIS version
 -- Changed: 3.0.1 install from unpackaged should include postgis schema #4581
 -- Changed: 3.0.0 also upgrade postgis_raster if it exists
-CREATE OR REPLACE FUNCTION postgis_extensions_upgrade() RETURNS text
-AS $$
+-- Changed: 3.4.0 to add target_version argument
+-- Replaces postgis_extensions_upgrade() deprecated in 3.4.0
+CREATE OR REPLACE FUNCTION postgis_extensions_upgrade(target_version text DEFAULT NULL) RETURNS text
+AS $BODY$
 DECLARE
 	rec record;
 	sql text;
 	var_schema text;
-	target_version text; -- TODO: optionally take as argument
 BEGIN
 
 	FOR rec IN
@@ -3109,7 +3110,7 @@ BEGIN
 
 
 END
-$$ LANGUAGE plpgsql VOLATILE;
+$BODY$ LANGUAGE plpgsql VOLATILE;
 
 -- Changed: 3.0.0
 -- Changed: 3.4.0 to include geos compiled version
diff --git a/regress/run_test.pl b/regress/run_test.pl
index a92957691..4f2c3d3f3 100755
--- a/regress/run_test.pl
+++ b/regress/run_test.pl
@@ -1659,7 +1659,8 @@ sub upgrade_spatial_extensions
 
     if ( $upgrade_via_function )
     {
-      $sql = "SELECT postgis_extensions_upgrade()";
+        # TODO: pass ${nextver} if supported by OPT_UPGRADE_FROM ?
+        $sql = "SELECT postgis_extensions_upgrade()";
     }
     elsif ( $OPT_UPGRADE_FROM =~ /^unpackaged/ )
     {

-----------------------------------------------------------------------

Summary of changes:
 NEWS                      | 2 ++
 doc/reference_version.xml | 8 ++++----
 postgis/postgis.sql.in    | 9 +++++----
 regress/run_test.pl       | 3 ++-
 4 files changed, 13 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list