[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0rc2-230-g1e96c9214

git at osgeo.org git at osgeo.org
Thu Oct 20 21:23:11 PDT 2022


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  1e96c9214ef814260d1d66247b3ffbde7a019b45 (commit)
      from  e3b01ac7bce14ac5c93ab3f92dcc82dfbbcc0e34 (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 1e96c9214ef814260d1d66247b3ffbde7a019b45
Author: Regina Obe <lr at pcorp.us>
Date:   Fri Oct 21 00:18:34 2022 -0400

    FIX compile against PostgreSQL 16
    1) get_guc_variables() function now requires number variables reference.
    Change to not use this function at all and replace with find_option,
    which does much the same but with less code
    
    2) Abs function removed in PG16.  As noted in Discussion:
    https://www.postgresql.org/message-id/flat/4beb42b5-216b-bce8-d452-d924d5794c63%40enterprisedb.com
    We should be using C lib abs or fabs.  Replaced this left over use with
    fabs, which we are already using elsewhere
    
    Closes #5261 for PostGIS 3.4.0

diff --git a/NEWS b/NEWS
index c1a1d6114..b2d931c69 100644
--- a/NEWS
+++ b/NEWS
@@ -6,11 +6,11 @@ xxxx/xx/xx
 
 * New Features *
   - New install-extension-upgrades command in postgis script (Sandro Santilli)
-  - #5257, Remove MemoryContextContains use for PG16 (Regina Obe)
+  - #5257, #5261 Support changes for PG16 (Regina Obe)
 
 * Enhancements *
   - #5194, do not update system catalogs from postgis_extensions_upgrade (Sandro Santilli)
-  - #5092, reduce number of upgrade paths installed on system (Sandro Santilli)
+  - #5092 reduce number of upgrade paths installed on system (Sandro Santilli)
 
 * Bug Fix *
 
diff --git a/libpgcommon/lwgeom_pg.c b/libpgcommon/lwgeom_pg.c
index e1724548b..dc751875b 100644
--- a/libpgcommon/lwgeom_pg.c
+++ b/libpgcommon/lwgeom_pg.c
@@ -496,16 +496,22 @@ postgis_guc_find_option(const char *name)
 {
 	const char **key = &name;
 	struct config_generic **res;
+	int			numOpts;
+
 
 	/*
 	 * By equating const char ** with struct config_generic *, we are assuming
 	 * the name field is first in config_generic.
 	 */
+#if POSTGIS_PGSQL_VERSION >= 160
+	res = find_option(&key, false, true, ERROR);
+#else
 	res = (struct config_generic **) bsearch((void *) &key,
 		 (void *) get_guc_variables(),
 		 GetNumConfigOptions(),
 		 sizeof(struct config_generic *),
 		 postgis_guc_var_compare);
+#endif;
 
 	/* Found nothing? Good */
 	if ( ! res ) return 0;
diff --git a/postgis/gserialized_gist_2d.c b/postgis/gserialized_gist_2d.c
index a47c58d3e..0d6a0e938 100644
--- a/postgis/gserialized_gist_2d.c
+++ b/postgis/gserialized_gist_2d.c
@@ -2054,7 +2054,8 @@ Datum gserialized_gist_picksplit_2d(PG_FUNCTION_ARGS)
 		{
 			box = (BOX2DF *) DatumGetPointer(entryvec->vector[
 												commonEntries[i].index].key);
-			commonEntries[i].delta = Abs(box2df_penalty(leftBox, box) - box2df_penalty(rightBox, box));
+			/** PG!6 Abs was removed in favor of standard c lib **/
+			commonEntries[i].delta = fabs(box2df_penalty(leftBox, box) - box2df_penalty(rightBox, box));
 		}
 
 		/*

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

Summary of changes:
 NEWS                          | 4 ++--
 libpgcommon/lwgeom_pg.c       | 6 ++++++
 postgis/gserialized_gist_2d.c | 3 ++-
 3 files changed, 10 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list