[postgis-tickets] [SCM] PostGIS; Spatial objects for PostgreSQL. branch master updated. e6a5f6cf2334a7936f220fccd7761c3521a0bc6d

git at osgeo.org git at osgeo.org
Tue Oct 29 02:17:58 PDT 2019


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; Spatial objects for PostgreSQL.".

The branch, master has been updated
       via  e6a5f6cf2334a7936f220fccd7761c3521a0bc6d (commit)
      from  4ae90beb56b677a8497ea2cdc26d1226933c8e4d (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 e6a5f6cf2334a7936f220fccd7761c3521a0bc6d
Author: Sandro Santilli <strk at kbt.io>
Date:   Tue Oct 29 10:17:18 2019 +0100

    Deprecate postgis_svn_version(), replaced by postgis_lib_revision()

diff --git a/NEWS b/NEWS
index 28bce06..bba30be 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,10 @@
 PostGIS 3.1.0
 2020/XX/XX
 
+* Deprecated signatures *
+  - Function postgis_svn_version() replaced by postgis_lib_revision()
+    (Sandro Santilli)
+
 * Breaking changes *
   -
 
diff --git a/postgis/lwgeom_functions_basic.c b/postgis/lwgeom_functions_basic.c
index d3efd20..acc84cc 100644
--- a/postgis/lwgeom_functions_basic.c
+++ b/postgis/lwgeom_functions_basic.c
@@ -49,6 +49,7 @@ Datum postgis_version(PG_FUNCTION_ARGS);
 Datum postgis_liblwgeom_version(PG_FUNCTION_ARGS);
 Datum postgis_lib_version(PG_FUNCTION_ARGS);
 Datum postgis_svn_version(PG_FUNCTION_ARGS);
+Datum postgis_lib_revision(PG_FUNCTION_ARGS);
 Datum postgis_libxml_version(PG_FUNCTION_ARGS);
 Datum postgis_lib_build_date(PG_FUNCTION_ARGS);
 Datum LWGEOM_length2d_linestring(PG_FUNCTION_ARGS);
@@ -182,9 +183,21 @@ Datum postgis_lib_version(PG_FUNCTION_ARGS)
 	PG_RETURN_TEXT_P(result);
 }
 
+/*
+ * Deprecated as of version 3.1.0 but needs to be kept
+ * around until 4.x as we use the same library filename
+ * for any 3.x.x version of PostGIS and we don't want to
+ * fail at loading the library due to missing symbol.
+ */
 PG_FUNCTION_INFO_V1(postgis_svn_version);
 Datum postgis_svn_version(PG_FUNCTION_ARGS)
 {
+	return postgis_lib_revision(fcinfo);
+}
+
+PG_FUNCTION_INFO_V1(postgis_lib_revision);
+Datum postgis_lib_revision(PG_FUNCTION_ARGS)
+{
 	static int rev = POSTGIS_SVN_REVISION;
 	char ver[32];
 	if (rev > 0)
diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in
index ac6cfd9..ddf7e41 100644
--- a/postgis/postgis.sql.in
+++ b/postgis/postgis.sql.in
@@ -2757,7 +2757,7 @@ CREATE OR REPLACE FUNCTION postgis_lib_version() RETURNS text
 	LANGUAGE 'c' IMMUTABLE; -- a new lib will require a new session
 
 -- NOTE: from 1.1.0 to 1.5.x this was the same of postgis_lib_version()
--- NOTE: from 2.0.0 up it includes postgis_svn_revision()
+-- NOTE: from 2.0.0 up it includes postgis revision
 CREATE OR REPLACE FUNCTION postgis_scripts_released() RETURNS text
 	AS 'MODULE_PATHNAME'
 	LANGUAGE 'c' IMMUTABLE;
@@ -2766,10 +2766,23 @@ CREATE OR REPLACE FUNCTION postgis_geos_version() RETURNS text
 	AS 'MODULE_PATHNAME'
 	LANGUAGE 'c' IMMUTABLE;
 
-CREATE OR REPLACE FUNCTION postgis_svn_version() RETURNS text
+--- Availability: 3.1.0
+CREATE OR REPLACE FUNCTION postgis_lib_revision() RETURNS text
 	AS 'MODULE_PATHNAME'
 	LANGUAGE 'c' IMMUTABLE;
 
+--- Availability: 2.0.0
+--- Deprecation in 3.1.0
+CREATE OR REPLACE FUNCTION postgis_svn_version()
+RETURNS text AS $$
+	SELECT @extschema at ._postgis_deprecate(
+		'postgis_svn_version', 'postgis_lib_revision', '3.1.0');
+	SELECT @extschema at .postgis_lib_revision();
+$$
+LANGUAGE 'sql' IMMUTABLE SECURITY INVOKER;
+
+
+
 CREATE OR REPLACE FUNCTION postgis_libxml_version() RETURNS text
 	AS 'MODULE_PATHNAME'
 	LANGUAGE 'c' IMMUTABLE;
@@ -2882,7 +2895,7 @@ CREATE OR REPLACE FUNCTION postgis_full_version() RETURNS text
 AS $$
 DECLARE
 	libver text;
-	svnver text;
+	librev text;
 	projver text;
 	geosver text;
 	sfcgalver text;
@@ -2934,7 +2947,7 @@ BEGIN
 	SELECT @extschema at .postgis_libxml_version() INTO libxmlver;
 	SELECT @extschema at .postgis_scripts_installed() INTO dbproc;
 	SELECT @extschema at .postgis_scripts_released() INTO relproc;
-	SELECT @extschema at .postgis_svn_version() INTO svnver;
+	SELECT @extschema at .postgis_lib_revision() INTO librev;
 	BEGIN
 		SELECT topology.postgis_topology_scripts_installed() INTO topo_scr_ver;
 	EXCEPTION
@@ -2966,8 +2979,8 @@ BEGIN
 
 	fullver = 'POSTGIS="' || libver;
 
-	IF  svnver IS NOT NULL THEN
-		fullver = fullver || ' r' || svnver;
+	IF  librev IS NOT NULL THEN
+		fullver = fullver || ' r' || librev;
 	END IF;
 
 	fullver = fullver || '"';
diff --git a/regress/run_test.pl b/regress/run_test.pl
index 0839f60..ccbfea2 100755
--- a/regress/run_test.pl
+++ b/regress/run_test.pl
@@ -416,7 +416,9 @@ if ( $OPT_DUMPRESTORE )
 
 my $geosver =  sql("select postgis_geos_version()");
 my $projver = sql("select postgis_proj_version()");
-my $svnrev = sql("select postgis_svn_version()");
+# TODO: call postgis_lib_revision() instead of postgis_svn_version
+#       if $libver >= 3.1.0
+my $librev = sql("select postgis_svn_version()");
 my $libbuilddate = sql("select postgis_lib_build_date()");
 my $pgsqlver = sql("select version()");
 my $gdalver = sql("select postgis_gdal_version()") if $OPT_WITH_RASTER;
@@ -426,7 +428,7 @@ my $raster_scriptver = sql("select postgis_raster_scripts_installed()")
   if ( $OPT_WITH_RASTER );
 
 print "$pgsqlver\n";
-print "  Postgis $libver - r${svnrev} - $libbuilddate\n";
+print "  Postgis $libver - (${librev}) - $libbuilddate\n";
 print "  scripts ${scriptver}\n";
 print "  raster scripts ${raster_scriptver}\n" if ( $OPT_WITH_RASTER );
 print "  GEOS: $geosver\n" if $geosver;

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

Summary of changes:
 NEWS                             |  4 ++++
 postgis/lwgeom_functions_basic.c | 13 +++++++++++++
 postgis/postgis.sql.in           | 25 +++++++++++++++++++------
 regress/run_test.pl              |  6 ++++--
 4 files changed, 40 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
PostGIS; Spatial objects for PostgreSQL.


More information about the postgis-tickets mailing list