[postgis-tickets] r15402 - Get rid of all if def needed for versions of PostgreSQL lower than 9.3 and GEOS 3.3

Regina Obe lr at pcorp.us
Thu May 25 21:03:18 PDT 2017


Author: robe
Date: 2017-05-25 21:03:17 -0700 (Thu, 25 May 2017)
New Revision: 15402

Modified:
   trunk/configure.ac
   trunk/doc/extras_tigergeocoder.xml
   trunk/doc/postgis.xml
   trunk/postgis/Makefile.in
   trunk/postgis/lwgeom_accum.c
   trunk/postgis/lwgeom_backend_api.c
   trunk/postgis/lwgeom_dumppoints.c
   trunk/postgis/lwgeom_functions_analytic.c
   trunk/postgis/lwgeom_geos.c
   trunk/postgis/lwgeom_inout.c
   trunk/postgis/postgis.sql.in
   trunk/postgis/postgis_module.c
   trunk/raster/rt_pg/rtpg_band_properties.c
   trunk/raster/rt_pg/rtpg_gdal.c
   trunk/raster/rt_pg/rtpg_mapalgebra.c
   trunk/raster/rt_pg/rtpg_pixel.c
   trunk/raster/rt_pg/rtpg_raster_properties.c
   trunk/raster/rt_pg/rtpg_statistics.c
   trunk/raster/rt_pg/rtpostgis.c
   trunk/regress/Makefile.in
Log:
Get rid of all if def needed for versions of PostgreSQL lower than 9.3 and GEOS 3.3
Document dropping support for PostgreSQL 9.2
Note didn't change postgis/gserialized_estimate.c which also has an ifdef (leaving that for pramsey)
References #3761 for PostGIS 2.4

Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2017-05-24 18:55:17 UTC (rev 15401)
+++ trunk/configure.ac	2017-05-26 04:03:17 UTC (rev 15402)
@@ -455,9 +455,9 @@
   PGSQL_SHAREDIR=`"$PG_CONFIG" --sharedir`
 
   AC_MSG_RESULT([checking PostgreSQL version... $PGSQL_FULL_VERSION])
-  dnl Ensure that we are using PostgreSQL >= 9.2
-  if test $POSTGIS_PGSQL_VERSION -lt 92; then
-    AC_MSG_ERROR([PostGIS requires PostgreSQL >= 9.2])
+  dnl Ensure that we are using PostgreSQL >= 9.3
+  if test $POSTGIS_PGSQL_VERSION -lt 93; then
+    AC_MSG_ERROR([PostGIS requires PostgreSQL >= 9.3])
   fi
 
   HAVE_BRIN=no

Modified: trunk/doc/extras_tigergeocoder.xml
===================================================================
--- trunk/doc/extras_tigergeocoder.xml	2017-05-24 18:55:17 UTC (rev 15401)
+++ trunk/doc/extras_tigergeocoder.xml	2017-05-26 04:03:17 UTC (rev 15402)
@@ -966,6 +966,13 @@
           <listitem>
             <para><varname>parsed</varname> boolean - denotes if addess was formed from normalize process. The normalize_address function sets this to true before returning the address.</para>
           </listitem>
+          
+          <listitem>
+            <para><varname>zip4</varname> last 4 digits of a 9 digit zip code. Availability: PostGIS 2.4.0.</para>
+          </listitem>
+          <listitem>
+            <para><varname>address_alphanumeric</varname> Full street number even if it has alpha characters like 17R. Parsing of this is better using <xref linkend="Pagc_Normalize_Address" /> function.  Availability: PostGIS 2.4.0.</para>
+          </listitem>
         </orderedlist>
 
       </refsection>
@@ -999,7 +1006,7 @@
       </refsection>
     </refentry>
 
-        <refentry id="Pagc_Normalize_Address">
+    <refentry id="Pagc_Normalize_Address">
       <refnamediv>
         <refname>Pagc_Normalize_Address</refname>
 
@@ -1063,6 +1070,12 @@
           <listitem>
             <para><varname>parsed</varname> boolean - denotes if addess was formed from normalize process. The normalize_address function sets this to true before returning the address.</para>
           </listitem>
+          <listitem>
+            <para><varname>zip4</varname> last 4 digits of a 9 digit zip code. Availability PostGIS 2.4.0.</para>
+          </listitem>
+          <listitem>
+            <para><varname>address_alphanumeric</varname> Full street number even if it has alpha characters like 17R or 12 1/2.  Availability PostGIS 2.4.0.</para>
+          </listitem>
         </orderedlist>
 
       </refsection>

Modified: trunk/doc/postgis.xml
===================================================================
--- trunk/doc/postgis.xml	2017-05-24 18:55:17 UTC (rev 15401)
+++ trunk/doc/postgis.xml	2017-05-26 04:03:17 UTC (rev 15402)
@@ -4,7 +4,7 @@
 
 <!-- This value is automatically generated by the Makefile -->
 <!ENTITY last_release_version "@@LAST_RELEASE_VERSION@@">
-<!ENTITY last_minor_version "2.2">
+<!ENTITY last_minor_version "2.3">
 
 <!-- ONCE Tagged, this need to change to http://download.osgeo.org/postgis/source/postgis-@@LAST_RELEASE_VERSION@@.tar.gz -->
 <!-- In dev should be, this need to change to http://postgis.net/stuff/postgis-@@LAST_RELEASE_VERSION@@.tar.gz -->
@@ -12,8 +12,8 @@
 
 <!-- Change these values to update the version numbers referenced within the documentation -->
 <!ENTITY last_proj_release_version "4.8.0">
-<!ENTITY last_geos_release_version "3.4.0">
-<!ENTITY min_postgres_version "9.2">
+<!ENTITY last_geos_release_version "3.6.2">
+<!ENTITY min_postgres_version "9.3">
 
 <!ENTITY introduction SYSTEM "introduction.xml">
 <!ENTITY installation SYSTEM "installation.xml">

Modified: trunk/postgis/Makefile.in
===================================================================
--- trunk/postgis/Makefile.in	2017-05-24 18:55:17 UTC (rev 15401)
+++ trunk/postgis/Makefile.in	2017-05-26 04:03:17 UTC (rev 15402)
@@ -160,10 +160,10 @@
 # so that no prefix is included. This allows us to relocate to a temporary
 # directory for regression testing.
 ifeq ($(REGRESS),1)
-        bindir=/bin
-        pkglibdir=/lib
-        datadir=/share
-        datamoduledir=contrib/postgis
+	bindir=/bin
+	pkglibdir=/lib
+	datadir=/share
+	datamoduledir=contrib/postgis
 endif
 
 # Make all PostGIS objects depend upon liblwgeom, so that if an underlying

Modified: trunk/postgis/lwgeom_accum.c
===================================================================
--- trunk/postgis/lwgeom_accum.c	2017-05-24 18:55:17 UTC (rev 15401)
+++ trunk/postgis/lwgeom_accum.c	2017-05-26 04:03:17 UTC (rev 15402)
@@ -386,13 +386,9 @@
 	FunctionCallInfoData fcinfo;
 	Datum           result;
 
-#if POSTGIS_PGSQL_VERSION > 90
 
 	InitFunctionCallInfoData(fcinfo, NULL, 1, InvalidOid, NULL, NULL);
-#else
 
-	InitFunctionCallInfoData(fcinfo, NULL, 1, NULL, NULL);
-#endif
 
 	fcinfo.arg[0] = arg1;
 	fcinfo.argnull[0] = false;

Modified: trunk/postgis/lwgeom_backend_api.c
===================================================================
--- trunk/postgis/lwgeom_backend_api.c	2017-05-24 18:55:17 UTC (rev 15401)
+++ trunk/postgis/lwgeom_backend_api.c	2017-05-26 04:03:17 UTC (rev 15402)
@@ -146,9 +146,7 @@
 				(char *)lwgeom_backends[0].name, /* bootValue */
 				PGC_USERSET, /* GucContext context */
 				0, /* int flags */
-#if POSTGIS_PGSQL_VERSION >= 91
 				NULL, /* GucStringCheckHook check_hook */
-#endif
 				lwgeom_backend_switch, /* GucStringAssignHook assign_hook */
 				NULL  /* GucShowHook show_hook */
 				);

Modified: trunk/postgis/lwgeom_dumppoints.c
===================================================================
--- trunk/postgis/lwgeom_dumppoints.c	2017-05-24 18:55:17 UTC (rev 15401)
+++ trunk/postgis/lwgeom_dumppoints.c	2017-05-26 04:03:17 UTC (rev 15402)
@@ -33,10 +33,10 @@
 
 #include "../postgis_config.h"
 #include "lwgeom_pg.h"
-#if POSTGIS_PGSQL_VERSION > 92
+
 #include "access/htup_details.h"
-#endif
 
+
 #include "liblwgeom.h"
 
 /* ST_DumpPoints for postgis.

Modified: trunk/postgis/lwgeom_functions_analytic.c
===================================================================
--- trunk/postgis/lwgeom_functions_analytic.c	2017-05-24 18:55:17 UTC (rev 15401)
+++ trunk/postgis/lwgeom_functions_analytic.c	2017-05-26 04:03:17 UTC (rev 15402)
@@ -33,11 +33,8 @@
 #include "lwgeom_rtree.h"
 #include "lwgeom_functions_analytic.h"
 
-#if POSTGIS_PGSQL_VERSION >= 93
+
 #include "access/htup_details.h"
-#else
-#include "access/htup.h"
-#endif
 
 /***********************************************************************
  * Simple Douglas-Peucker line simplification.

Modified: trunk/postgis/lwgeom_geos.c
===================================================================
--- trunk/postgis/lwgeom_geos.c	2017-05-24 18:55:17 UTC (rev 15401)
+++ trunk/postgis/lwgeom_geos.c	2017-05-26 04:03:17 UTC (rev 15402)
@@ -35,12 +35,9 @@
 #include "utils/lsyscache.h"
 #include "utils/numeric.h"
 
-#if POSTGIS_PGSQL_VERSION >= 93
 #include "access/htup_details.h"
-#else
-#include "access/htup.h"
-#endif
 
+
 /* PostGIS */
 #include "lwgeom_functions_analytic.h" /* for point_in_polygon */
 #include "lwgeom_geos.h"

Modified: trunk/postgis/lwgeom_inout.c
===================================================================
--- trunk/postgis/lwgeom_inout.c	2017-05-24 18:55:17 UTC (rev 15401)
+++ trunk/postgis/lwgeom_inout.c	2017-05-26 04:03:17 UTC (rev 15402)
@@ -49,10 +49,10 @@
 #include "geography.h" /* for lwgeom_valid_typmod */
 #include "lwgeom_transform.h"
 
-#if POSTGIS_PGSQL_VERSION > 92
+
 #include "access/htup_details.h"
-#endif
 
+
 void elog_ERROR(const char* string);
 
 Datum LWGEOM_in(PG_FUNCTION_ARGS);

Modified: trunk/postgis/postgis.sql.in
===================================================================
--- trunk/postgis/postgis.sql.in	2017-05-24 18:55:17 UTC (rev 15401)
+++ trunk/postgis/postgis.sql.in	2017-05-26 04:03:17 UTC (rev 15402)
@@ -732,11 +732,9 @@
 	OPERATOR        10       <<| ,
 	OPERATOR        11       |>> ,
 	OPERATOR        12       |&> ,
-#if POSTGIS_PGSQL_VERSION >= 91
 	OPERATOR        13       <-> FOR ORDER BY pg_catalog.float_ops,
 	OPERATOR        14       <#> FOR ORDER BY pg_catalog.float_ops,
 	FUNCTION        8        geometry_gist_distance_2d (internal, geometry, int4),
-#endif
 	FUNCTION        1        geometry_gist_consistent_2d (internal, geometry, int4),
 	FUNCTION        2        geometry_gist_union_2d (bytea, internal),
 	FUNCTION        3        geometry_gist_compress_2d (internal),
@@ -860,7 +858,6 @@
 --	OPERATOR        6        ~=	,
 --	OPERATOR        7        ~	,
 --	OPERATOR        8        @	,
-#if POSTGIS_PGSQL_VERSION >= 91
 	-- Availability: 2.2.0
 	OPERATOR        13       <<->> FOR ORDER BY pg_catalog.float_ops,
 #if POSTGIS_PGSQL_VERSION >= 95
@@ -869,7 +866,6 @@
 #endif
 	-- Availability: 2.2.0
 	FUNCTION        8        geometry_gist_distance_nd (internal, geometry, int4),
-#endif
 	FUNCTION        1        geometry_gist_consistent_nd (internal, geometry, int4),
 	FUNCTION        2        geometry_gist_union_nd (bytea, internal),
 	FUNCTION        3        geometry_gist_compress_nd (internal),

Modified: trunk/postgis/postgis_module.c
===================================================================
--- trunk/postgis/postgis_module.c	2017-05-24 18:55:17 UTC (rev 15401)
+++ trunk/postgis/postgis_module.c	2017-05-26 04:03:17 UTC (rev 15402)
@@ -79,9 +79,7 @@
     0, /* bootValue */
     PGC_SUSET, /* GucContext context */
     GUC_UNIT_MS, /* int flags */
-#if POSTGIS_PGSQL_VERSION >= 91
     NULL, /* GucStringCheckHook check_hook */
-#endif
     NULL, /* GucStringAssignHook assign_hook */
     NULL  /* GucShowHook show_hook */
    );
@@ -97,9 +95,7 @@
     "Welcome to PostGIS " POSTGIS_VERSION, /* bootValue */
     PGC_SUSET, /* GucContext context */
     GUC_UNIT_MS, /* int flags */
-#if POSTGIS_PGSQL_VERSION >= 91
     NULL, /* GucStringCheckHook check_hook */
-#endif
     NULL, /* GucStringAssignHook assign_hook */
     NULL  /* GucShowHook show_hook */
    );

Modified: trunk/raster/rt_pg/rtpg_band_properties.c
===================================================================
--- trunk/raster/rt_pg/rtpg_band_properties.c	2017-05-24 18:55:17 UTC (rev 15401)
+++ trunk/raster/rt_pg/rtpg_band_properties.c	2017-05-26 04:03:17 UTC (rev 15402)
@@ -37,10 +37,10 @@
 
 #include "../../postgis_config.h"
 
-#if POSTGIS_PGSQL_VERSION > 92
+
 #include "access/htup_details.h" /* for heap_form_tuple() */
-#endif
 
+
 #include "rtpostgis.h"
 
 /* Get all the properties of a raster band */

Modified: trunk/raster/rt_pg/rtpg_gdal.c
===================================================================
--- trunk/raster/rt_pg/rtpg_gdal.c	2017-05-24 18:55:17 UTC (rev 15401)
+++ trunk/raster/rt_pg/rtpg_gdal.c	2017-05-26 04:03:17 UTC (rev 15402)
@@ -37,10 +37,10 @@
 
 #include "../../postgis_config.h"
 
-#if POSTGIS_PGSQL_VERSION > 92
+
 #include "access/htup_details.h" /* for heap_form_tuple() */
-#endif
 
+
 #include "rtpostgis.h"
 #include "rtpg_internal.h"
 

Modified: trunk/raster/rt_pg/rtpg_mapalgebra.c
===================================================================
--- trunk/raster/rt_pg/rtpg_mapalgebra.c	2017-05-24 18:55:17 UTC (rev 15401)
+++ trunk/raster/rt_pg/rtpg_mapalgebra.c	2017-05-26 04:03:17 UTC (rev 15402)
@@ -836,11 +836,8 @@
 			elog(NOTICE, "Function provided is VOLATILE. Unless required and for best performance, function should be IMMUTABLE or STABLE");
 
 		/* prep function call data */
-#if POSTGIS_PGSQL_VERSION > 90
 		InitFunctionCallInfoData(arg->callback.ufc_info, &(arg->callback.ufl_info), arg->callback.ufl_info.fn_nargs, InvalidOid, NULL, NULL);
-#else
-		InitFunctionCallInfoData(arg->callback.ufc_info, &(arg->callback.ufl_info), arg->callback.ufl_info.fn_nargs, NULL, NULL);
-#endif
+
 		memset(arg->callback.ufc_info.argnull, FALSE, sizeof(bool) * arg->callback.ufl_info.fn_nargs);
 
 		/* userargs (7) */
@@ -5330,11 +5327,8 @@
     }
 
     /* prep function call data */
-#if POSTGIS_PGSQL_VERSION <= 90
-    InitFunctionCallInfoData(cbdata, &cbinfo, 2, InvalidOid, NULL);
-#else
     InitFunctionCallInfoData(cbdata, &cbinfo, 2, InvalidOid, NULL, NULL);
-#endif
+
     memset(cbdata.argnull, FALSE, sizeof(bool) * cbinfo.fn_nargs);
 
     /* check that the function isn't strict if the args are null. */

Modified: trunk/raster/rt_pg/rtpg_pixel.c
===================================================================
--- trunk/raster/rt_pg/rtpg_pixel.c	2017-05-24 18:55:17 UTC (rev 15401)
+++ trunk/raster/rt_pg/rtpg_pixel.c	2017-05-26 04:03:17 UTC (rev 15402)
@@ -38,10 +38,10 @@
 #include "lwgeom_pg.h"
 
 
-#if POSTGIS_PGSQL_VERSION > 92
+
 #include "access/htup_details.h" /* for heap_form_tuple() */
-#endif
 
+
 #include "rtpostgis.h"
 
 /* Get pixel value */

Modified: trunk/raster/rt_pg/rtpg_raster_properties.c
===================================================================
--- trunk/raster/rt_pg/rtpg_raster_properties.c	2017-05-24 18:55:17 UTC (rev 15401)
+++ trunk/raster/rt_pg/rtpg_raster_properties.c	2017-05-26 04:03:17 UTC (rev 15402)
@@ -33,10 +33,10 @@
 
 #include "../../postgis_config.h"
 
-#if POSTGIS_PGSQL_VERSION > 92
+
 #include "access/htup_details.h" /* for heap_form_tuple() */
-#endif
 
+
 #include "rtpostgis.h"
 
 /* Get all the properties of a raster */

Modified: trunk/raster/rt_pg/rtpg_statistics.c
===================================================================
--- trunk/raster/rt_pg/rtpg_statistics.c	2017-05-24 18:55:17 UTC (rev 15401)
+++ trunk/raster/rt_pg/rtpg_statistics.c	2017-05-26 04:03:17 UTC (rev 15402)
@@ -39,10 +39,10 @@
 
 #include "../../postgis_config.h"
 
-#if POSTGIS_PGSQL_VERSION > 92
+
 #include "access/htup_details.h" /* for heap_form_tuple() */
-#endif
 
+
 #include "rtpostgis.h"
 
 /* Get summary stats */

Modified: trunk/raster/rt_pg/rtpostgis.c
===================================================================
--- trunk/raster/rt_pg/rtpostgis.c	2017-05-24 18:55:17 UTC (rev 15401)
+++ trunk/raster/rt_pg/rtpostgis.c	2017-05-26 04:03:17 UTC (rev 15402)
@@ -500,9 +500,7 @@
 			NULL, /* bootValue */
 			PGC_SUSET, /* GucContext context */
 			0, /* int flags */
-#if POSTGIS_PGSQL_VERSION >= 91
 			NULL, /* GucStringCheckHook check_hook */
-#endif
 			rtpg_assignHookGDALDataPath, /* GucStringAssignHook assign_hook */
 			NULL  /* GucShowHook show_hook */
 		);
@@ -525,9 +523,7 @@
 			boot_postgis_gdal_enabled_drivers, /* bootValue */
 			PGC_SUSET, /* GucContext context */
 			0, /* int flags */
-#if POSTGIS_PGSQL_VERSION >= 91
 			NULL, /* GucStringCheckHook check_hook */
-#endif
 			rtpg_assignHookGDALEnabledDrivers, /* GucStringAssignHook assign_hook */
 			NULL  /* GucShowHook show_hook */
 		);
@@ -550,9 +546,7 @@
 			boot_postgis_enable_outdb_rasters, /* bootValue */
 			PGC_SUSET, /* GucContext context */
 			0, /* int flags */
-#if POSTGIS_PGSQL_VERSION >= 91
 			NULL, /* GucStringCheckHook check_hook */
-#endif
 			rtpg_assignHookEnableOutDBRasters, /* GucBoolAssignHook assign_hook */
 			NULL  /* GucShowHook show_hook */
 		);

Modified: trunk/regress/Makefile.in
===================================================================
--- trunk/regress/Makefile.in	2017-05-24 18:55:17 UTC (rev 15401)
+++ trunk/regress/Makefile.in	2017-05-26 04:03:17 UTC (rev 15402)
@@ -145,28 +145,24 @@
 	wkt \
 	wmsservers
 
-ifeq ($(shell expr $(POSTGIS_PGSQL_VERSION) ">=" 91),1)
 ifeq ($(shell expr $(POSTGIS_PGSQL_VERSION) "<"  95),1)
 	# Index supported KNN only available in PostgreSQL 9.1 and higher
 	# For 9.5 and higher, use the recheck suite instead
 	TESTS += knn
 endif
-endif
 
 ifeq ($(shell expr $(POSTGIS_PGSQL_VERSION) ">=" 95),1)
 	# Index supported KNN recheck only available in PostgreSQL 9.5 and higher
 	TESTS += knn_recheck \
-           temporal_knn
+			temporal_knn
 endif
 
-ifeq ($(shell expr $(POSTGIS_GEOS_VERSION) ">=" 32),1)
-	# GEOS-3.3 adds:
-	# ST_HausdorffDistance, ST_Buffer(params)
-	TESTS += \
-		hausdorff \
-		regress_buffer_params
-endif
 
+TESTS += \
+	hausdorff \
+	regress_buffer_params
+
+
 ifeq ($(shell expr $(POSTGIS_GEOS_VERSION) ">=" 37),1)
 	# GEOS-3.7 adds:
 	# ST_FrechetDistance
@@ -174,22 +170,22 @@
 		frechet
 endif
 
-ifeq ($(shell expr $(POSTGIS_GEOS_VERSION) ">=" 33),1)
-	# GEOS-3.3 adds:
-	# ST_RelateMatch, ST_IsValidDetail, ST_SharedPaths ,
-	# ST_Snap, ST_UnaryUnion, ST_MakeClean
-	TESTS += \
-		offsetcurve \
-		relatematch \
-		isvaliddetail \
-		sharedpaths \
-		snap \
-		node \
-		unaryunion \
-		clean \
-		relate_bnr
-endif
 
+# GEOS-3.3 adds:
+# ST_RelateMatch, ST_IsValidDetail, ST_SharedPaths ,
+# ST_Snap, ST_UnaryUnion, ST_MakeClean
+TESTS += \
+	offsetcurve \
+	relatematch \
+	isvaliddetail \
+	sharedpaths \
+	snap \
+	node \
+	unaryunion \
+	clean \
+	relate_bnr
+
+
 ifeq ($(shell expr $(POSTGIS_GEOS_VERSION) ">=" 34),1)
 	# GEOS-3.4 adds:
 	# ST_DelaunayTriangles



More information about the postgis-tickets mailing list