[postgis-tickets] r17095 - Remove support for Postgres < 9.5.

Darafei komzpa at gmail.com
Mon Dec 3 01:03:58 PST 2018


Author: komzpa
Date: 2018-12-03 01:03:57 -0800 (Mon, 03 Dec 2018)
New Revision: 17095

Modified:
   trunk/NEWS
   trunk/configure.ac
   trunk/libpgcommon/lwgeom_pg.h
   trunk/postgis/Makefile.in
   trunk/postgis/geography_brin.sql.in
   trunk/postgis/gserialized_estimate.c
   trunk/postgis/gserialized_gist_2d.c
   trunk/postgis/gserialized_gist_nd.c
   trunk/postgis/lwgeom_functions_basic.c
   trunk/postgis/lwgeom_geos.c
   trunk/postgis/lwgeom_inout.c
   trunk/postgis/mvt.c
   trunk/postgis/postgis.sql.in
   trunk/raster/rt_pg/rtpg_band_properties.c
   trunk/raster/rt_pg/rtpg_geometry.c
   trunk/raster/rt_pg/rtpg_mapalgebra.c
   trunk/regress/core/Makefile.in
Log:
Remove support for Postgres < 9.5.

Closes https://github.com/postgis/postgis/pull/349
Closes #4229


Modified: trunk/NEWS
===================================================================
--- trunk/NEWS	2018-12-01 21:22:42 UTC (rev 17094)
+++ trunk/NEWS	2018-12-03 09:03:57 UTC (rev 17095)
@@ -8,7 +8,8 @@
            if you need the old behavior (Regina Obe)
   - #4230, ND box operators (overlaps, contains, within, equals) now don't look on
            dimentions that aren't present in both operands.
-           Please REINDEX your ND indexes after upgrade.
+           Please REINDEX your ND indexes after upgrade. (Darafei Praliaskouski)
+  - #4229, Dropped support for PostgreSQL < 9.5. (Darafei Praliaskouski)
 
 * New Features *
   - #2902, postgis_geos_noop (Sandro Santilli)

Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2018-12-01 21:22:42 UTC (rev 17094)
+++ trunk/configure.ac	2018-12-03 09:03:57 UTC (rev 17095)
@@ -468,11 +468,6 @@
     AC_MSG_ERROR([PostGIS requires PostgreSQL >= 9.5])
   fi
 
-  HAVE_BRIN=no
-  if test $POSTGIS_PGSQL_VERSION -gt 94; then
-    HAVE_BRIN=yes
-  fi
-
   HAVE_SPGIST=no
   if test $POSTGIS_PGSQL_VERSION -gt 100; then
     HAVE_SPGIST=yes
@@ -546,7 +541,6 @@
 
   AC_DEFINE_UNQUOTED([POSTGIS_PGSQL_VERSION], [$POSTGIS_PGSQL_VERSION], [PostgreSQL server version])
   AC_SUBST([POSTGIS_PGSQL_VERSION])
-  AC_SUBST([HAVE_BRIN])
   AC_SUBST([HAVE_SPGIST])
 
 fi dnl LIBLWGEOM_ONLY != no

Modified: trunk/libpgcommon/lwgeom_pg.h
===================================================================
--- trunk/libpgcommon/lwgeom_pg.h	2018-12-01 21:22:42 UTC (rev 17094)
+++ trunk/libpgcommon/lwgeom_pg.h	2018-12-03 09:03:57 UTC (rev 17095)
@@ -124,14 +124,6 @@
 */
 int gserialized_datum_get_gbox_p(Datum gsdatum, GBOX *gbox);
 
-/*
- * For PostgreSQL >= 8.5 redefine the STATRELATT macro to its
- * new value of STATRELATTINH
- */
-#if POSTGIS_PGSQL_VERSION >= 85
-	#define STATRELATT STATRELATTINH
-#endif
-
 /* PG-exposed */
 Datum BOX2D_same(PG_FUNCTION_ARGS);
 Datum BOX2D_overlap(PG_FUNCTION_ARGS);
@@ -151,34 +143,32 @@
 Datum LWGEOM_same(PG_FUNCTION_ARGS);
 
 /** needed for sp-gist support PostgreSQL 11+ **/
-//#if POSTGIS_PGSQL_VERSION > 100
-	Datum BOX3D_construct(PG_FUNCTION_ARGS);
+Datum BOX3D_construct(PG_FUNCTION_ARGS);
 
-	Datum LWGEOM_to_BOX2DF(PG_FUNCTION_ARGS);
-	Datum LWGEOM_to_BOX3D(PG_FUNCTION_ARGS);
-	Datum BOX3D_contains(PG_FUNCTION_ARGS);
-	Datum BOX3D_contained(PG_FUNCTION_ARGS);
-	Datum BOX3D_overlaps(PG_FUNCTION_ARGS);
-	Datum BOX3D_same(PG_FUNCTION_ARGS);
-	Datum BOX3D_left(PG_FUNCTION_ARGS);
-	Datum BOX3D_overleft(PG_FUNCTION_ARGS);
-	Datum BOX3D_right(PG_FUNCTION_ARGS)    ;
-	Datum BOX3D_overright(PG_FUNCTION_ARGS);
-	Datum BOX3D_below(PG_FUNCTION_ARGS);
-	Datum BOX3D_overbelow(PG_FUNCTION_ARGS);
-	Datum BOX3D_above(PG_FUNCTION_ARGS);
-	Datum BOX3D_overabove(PG_FUNCTION_ARGS);
-	Datum BOX3D_front(PG_FUNCTION_ARGS);
-	Datum BOX3D_overfront(PG_FUNCTION_ARGS);
-	Datum BOX3D_back(PG_FUNCTION_ARGS);
-	Datum BOX3D_overback(PG_FUNCTION_ARGS);
-	Datum BOX3D_distance(PG_FUNCTION_ARGS);
+Datum LWGEOM_to_BOX2DF(PG_FUNCTION_ARGS);
+Datum LWGEOM_to_BOX3D(PG_FUNCTION_ARGS);
+Datum BOX3D_contains(PG_FUNCTION_ARGS);
+Datum BOX3D_contained(PG_FUNCTION_ARGS);
+Datum BOX3D_overlaps(PG_FUNCTION_ARGS);
+Datum BOX3D_same(PG_FUNCTION_ARGS);
+Datum BOX3D_left(PG_FUNCTION_ARGS);
+Datum BOX3D_overleft(PG_FUNCTION_ARGS);
+Datum BOX3D_right(PG_FUNCTION_ARGS);
+Datum BOX3D_overright(PG_FUNCTION_ARGS);
+Datum BOX3D_below(PG_FUNCTION_ARGS);
+Datum BOX3D_overbelow(PG_FUNCTION_ARGS);
+Datum BOX3D_above(PG_FUNCTION_ARGS);
+Datum BOX3D_overabove(PG_FUNCTION_ARGS);
+Datum BOX3D_front(PG_FUNCTION_ARGS);
+Datum BOX3D_overfront(PG_FUNCTION_ARGS);
+Datum BOX3D_back(PG_FUNCTION_ARGS);
+Datum BOX3D_overback(PG_FUNCTION_ARGS);
+Datum BOX3D_distance(PG_FUNCTION_ARGS);
 
-	#define DatumGetBox3DP(X)    ((BOX3D *) DatumGetPointer(X))
-	#define Box3DPGetDatum(X)    PointerGetDatum(X)
-	#define PG_GETARG_BOX3D_P(n) DatumGetBox3DP(PG_GETARG_DATUM(n))
-	#define PG_RETURN_BOX3D_P(x) return Box3DPGetDatum(x)
-//#endif
+#define DatumGetBox3DP(X) ((BOX3D *)DatumGetPointer(X))
+#define Box3DPGetDatum(X) PointerGetDatum(X)
+#define PG_GETARG_BOX3D_P(n) DatumGetBox3DP(PG_GETARG_DATUM(n))
+#define PG_RETURN_BOX3D_P(x) return Box3DPGetDatum(x)
 
 Datum LWGEOM_force_2d(PG_FUNCTION_ARGS);
 Datum LWGEOM_force_3dm(PG_FUNCTION_ARGS);

Modified: trunk/postgis/Makefile.in
===================================================================
--- trunk/postgis/Makefile.in	2018-12-01 21:22:42 UTC (rev 17094)
+++ trunk/postgis/Makefile.in	2018-12-03 09:03:57 UTC (rev 17095)
@@ -32,10 +32,6 @@
 MODULE_big=postgis- at POSTGIS_MAJOR_VERSION@. at POSTGIS_MINOR_VERSION@
 endif
 
-ifeq (@HAVE_BRIN@,yes)
-BRIN_OBJ= brin_2d.o brin_nd.o brin_common.o
-endif
-
 # Files to be copied to the contrib/ directory
 SQL_built=postgis.sql postgis_for_extension.sql uninstall_postgis.sql postgis_upgrade.sql postgis_upgrade_for_extension.sql postgis_proc_set_search_path.sql legacy.sql uninstall_legacy.sql legacy_minimal.sql legacy_gist.sql
 DATA=../spatial_ref_sys.sql
@@ -56,10 +52,6 @@
 SQL_OBJS=$(SQL_objs)
 endif
 
-ifeq (@HAVE_BRIN@,yes)
-BRIN_OBJ= brin_2d.o brin_nd.o brin_common.o
-endif
-
 ifeq (@HAVE_SPGIST@,yes)
 SPGIST_OBJ= gserialized_spgist_2d.o gserialized_spgist_3d.o gserialized_spgist_nd.o
 endif
@@ -109,7 +101,9 @@
 	gserialized_gist_2d.o \
 	gserialized_gist_nd.o \
 	$(SPGIST_OBJ) \
-	$(BRIN_OBJ) \
+	brin_2d.o \
+	brin_nd.o \
+	brin_common.o \
 	gserialized_estimate.o \
 	geography_inout.o \
 	geography_btree.o \

Modified: trunk/postgis/geography_brin.sql.in
===================================================================
--- trunk/postgis/geography_brin.sql.in	2018-12-01 21:22:42 UTC (rev 17094)
+++ trunk/postgis/geography_brin.sql.in	2018-12-03 09:03:57 UTC (rev 17095)
@@ -1,4 +1,3 @@
-#if POSTGIS_PGSQL_VERSION > 94
 --------------------------------------------------------------------
 -- BRIN support for geographies                                   --
 --------------------------------------------------------------------
@@ -72,5 +71,3 @@
     OPERATOR      3        &&(gidx, geography),
     OPERATOR      3        &&(gidx, gidx),
   STORAGE gidx;
-
-#endif

Modified: trunk/postgis/gserialized_estimate.c
===================================================================
--- trunk/postgis/gserialized_estimate.c	2018-12-01 21:22:42 UTC (rev 17094)
+++ trunk/postgis/gserialized_estimate.c	2018-12-03 09:03:57 UTC (rev 17095)
@@ -102,9 +102,7 @@
 
 #include "../postgis_config.h"
 
-#if POSTGIS_PGSQL_VERSION >= 93
-	#include "access/htup_details.h"
-#endif
+#include "access/htup_details.h"
 
 #include "stringbuffer.h"
 #include "liblwgeom.h"
@@ -147,15 +145,15 @@
 Datum geometry_estimated_extent(PG_FUNCTION_ARGS);
 
 /*
-* Assign a number to the n-dimensional statistics kind
-*
-* tgl suggested:
-*
-* 1-100:	reserved for assignment by the core Postgres project
-* 100-199: reserved for assignment by PostGIS
-* 200-9999: reserved for other globally-known stats kinds
-* 10000-32767: reserved for private site-local use
-*/
+ * Assign a number to the n-dimensional statistics kind
+ *
+ * tgl suggested:
+ *
+ * 1-100:       reserved for assignment by the core Postgres project
+ * 100-199:     reserved for assignment by PostGIS
+ * 200-9999:    reserved for other globally-known stats kinds
+ * 10000-32767: reserved for private site-local use
+ */
 #define STATISTIC_KIND_ND 102
 #define STATISTIC_KIND_2D 103
 #define STATISTIC_SLOT_ND 0

Modified: trunk/postgis/gserialized_gist_2d.c
===================================================================
--- trunk/postgis/gserialized_gist_2d.c	2018-12-01 21:22:42 UTC (rev 17094)
+++ trunk/postgis/gserialized_gist_2d.c	2018-12-03 09:03:57 UTC (rev 17095)
@@ -108,8 +108,6 @@
 Datum gserialized_overbelow_2d(PG_FUNCTION_ARGS);
 Datum gserialized_distance_box_2d(PG_FUNCTION_ARGS);
 Datum gserialized_distance_centroid_2d(PG_FUNCTION_ARGS);
-
-#if POSTGIS_PGSQL_VERSION > 94
 Datum gserialized_contains_box2df_geom_2d(PG_FUNCTION_ARGS);
 Datum gserialized_contains_box2df_box2df_2d(PG_FUNCTION_ARGS);
 Datum gserialized_within_box2df_geom_2d(PG_FUNCTION_ARGS);
@@ -116,7 +114,6 @@
 Datum gserialized_within_box2df_box2df_2d(PG_FUNCTION_ARGS);
 Datum gserialized_overlaps_box2df_geom_2d(PG_FUNCTION_ARGS);
 Datum gserialized_overlaps_box2df_box2df_2d(PG_FUNCTION_ARGS);
-#endif
 
 /*
 ** true/false test function type
@@ -492,83 +489,6 @@
     return sqrt((a_x - b_x) * (a_x - b_x) + (a_y - b_y) * (a_y - b_y));
 }
 
-#if POSTGIS_PGSQL_VERSION < 95
-/**
-* Calculate the The node_box_edge->query_centroid distance
-* between the boxes.
-*/
-static double box2df_distance_node_centroid(const BOX2DF *node, const BOX2DF *query)
-{
-    BOX2DF q;
-    double qx, qy;
-    double d = 0.0;
-
-    /* Turn query into point */
-    q.xmin = q.xmax = (query->xmin + query->xmax) / 2.0;
-    q.ymin = q.ymax = (query->ymin + query->ymax) / 2.0;
-    qx = q.xmin;
-    qy = q.ymin;
-
-    /* Check for overlap */
-    if ( box2df_overlaps(node, &q) == LW_TRUE )
-        return 0.0;
-
-    /* Above or below */
-    if ( qx >= node->xmin && qx <= node->xmax )
-    {
-        if( qy > node->ymax )
-            d = qy - node->ymax;
-        else if ( qy < node->ymin )
-            d = node->ymin - qy;
-        return d;
-    }
-    /* Left or right */
-    else if ( qy >= node->ymin && qy <= node->ymax )
-    {
-        if ( qx > node->xmax )
-            d = qx - node->xmax;
-        else if ( qx < node->xmin )
-            d = node->xmin - qx;
-        return d;
-    }
-    /* Corner quadrants */
-    else
-    {
-        /* below/left of xmin/ymin */
-        if ( qx < node->xmin && qy < node->ymin )
-        {
-            d = (node->xmin - qx) * (node->xmin - qx) +
-                (node->ymin - qy) * (node->ymin - qy);
-        }
-        /* above/left of xmin/ymax */
-        else if ( qx < node->xmin && qy > node->ymax )
-        {
-            d = (node->xmin - qx) * (node->xmin - qx) +
-                (node->ymax - qy) * (node->ymax - qy);
-        }
-        /* above/right of xmax/ymax */
-        else if ( qx > node->xmax && qy > node->ymax )
-        {
-            d = (node->xmax - qx) * (node->xmax - qx) +
-                (node->ymax - qy) * (node->ymax - qy);
-        }
-        /* below/right of xmax/ymin */
-        else if ( qx > node->xmin && qy < node->ymin )
-        {
-            d = (node->xmax - qx) * (node->xmax - qx) +
-                (node->ymin - qy) * (node->ymin - qy);
-        }
-        else
-        {
-            /*ERROR*/
-			elog(ERROR, "%s: reached unreachable code", __func__);
-        }
-    }
-
-    return sqrt(d);
-}
-#endif
-
 /* Quick distance function */
 static inline double pt_distance(double ax, double ay, double bx, double by)
 {
@@ -707,7 +627,6 @@
 	return LW_FALSE;
 }
 
-#if POSTGIS_PGSQL_VERSION > 94
 static int
 gserialized_datum_predicate_box2df_geom_2d(const BOX2DF *br1, Datum gs2, box2df_predicate predicate)
 {
@@ -784,7 +703,6 @@
 
         PG_RETURN_BOOL(false);
 }
-#endif
 
 /***********************************************************************
 * GiST 2-D Index Operator Functions
@@ -1254,9 +1172,7 @@
 	BOX2DF *entry_box;
 	StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
 	double distance;
-#if POSTGIS_PGSQL_VERSION >= 95
 	bool *recheck = (bool *) PG_GETARG_POINTER(4);
-#endif
 
 	POSTGIS_DEBUG(4, "[GIST] 'distance' function called");
 
@@ -1277,8 +1193,6 @@
 	/* Get the entry box */
 	entry_box = (BOX2DF*)DatumGetPointer(entry->key);
 
-#if POSTGIS_PGSQL_VERSION >= 95
-
 	/* Box-style distance test */
 	if ( strategy == 14 ) /* operator <#> */
 	{
@@ -1300,27 +1214,7 @@
 		elog(ERROR, "%s: reached unreachable code", __func__);
 		PG_RETURN_NULL();
 	}
-#else
-	/* Box-style distance test */
-	if ( strategy == 14 )
-	{
-		distance = (double)box2df_distance(entry_box, &query_box);
-		PG_RETURN_FLOAT8(distance);
-	}
 
-	/* Treat leaf node tests different from internal nodes */
-	if (GIST_LEAF(entry))
-	{
-		/* Calculate distance to leaves */
-		distance = (double)box2df_distance_leaf_centroid(entry_box, &query_box);
-	}
-	else
-	{
-		/* Calculate distance for internal nodes */
-		distance = (double)box2df_distance_node_centroid(entry_box, &query_box);
-	}
-#endif
-
 	PG_RETURN_FLOAT8(distance);
 }
 

Modified: trunk/postgis/gserialized_gist_nd.c
===================================================================
--- trunk/postgis/gserialized_gist_nd.c	2018-12-01 21:22:42 UTC (rev 17094)
+++ trunk/postgis/gserialized_gist_nd.c	2018-12-03 09:03:57 UTC (rev 17095)
@@ -774,7 +774,6 @@
 	PG_RETURN_BOOL(false);
 }
 
-#if POSTGIS_PGSQL_VERSION > 94
 /*
 ** '~~' and operator function. Based on a GIDX and a serialized return true if
 ** the first is contained by the second.
@@ -802,7 +801,6 @@
 
 	PG_RETURN_BOOL(false);
 }
-#endif
 
 /*
 ** '@@' and operator function. Based on two serialized return true if

Modified: trunk/postgis/lwgeom_functions_basic.c
===================================================================
--- trunk/postgis/lwgeom_functions_basic.c	2018-12-01 21:22:42 UTC (rev 17094)
+++ trunk/postgis/lwgeom_functions_basic.c	2018-12-03 09:03:57 UTC (rev 17095)
@@ -1244,11 +1244,7 @@
 	count = 0;
 	outtype = 0;
 
-#if POSTGIS_PGSQL_VERSION >= 95
 	iterator = array_create_iterator(array, 0, NULL);
-#else
-	iterator = array_create_iterator(array, 0);
-#endif
 
 	while (array_iterate(iterator, &value, &isnull))
 	{
@@ -1420,11 +1416,7 @@
 	geoms = palloc(sizeof(LWGEOM *) * nelems);
 	ngeoms = 0;
 
-#if POSTGIS_PGSQL_VERSION >= 95
 	iterator = array_create_iterator(array, 0, NULL);
-#else
-	iterator = array_create_iterator(array, 0);
-#endif
 
 	while (array_iterate(iterator, &value, &isnull))
 	{

Modified: trunk/postgis/lwgeom_geos.c
===================================================================
--- trunk/postgis/lwgeom_geos.c	2018-12-01 21:22:42 UTC (rev 17094)
+++ trunk/postgis/lwgeom_geos.c	2018-12-03 09:03:57 UTC (rev 17095)
@@ -372,12 +372,8 @@
 	if ( nelems == 0 ) PG_RETURN_NULL();
 
 	/* Quick scan for nulls */
-#if POSTGIS_PGSQL_VERSION >= 95
 	iterator = array_create_iterator(array, 0, NULL);
-#else
-	iterator = array_create_iterator(array, 0);
-#endif
-	while( array_iterate(iterator, &value, &isnull) )
+	while (array_iterate(iterator, &value, &isnull))
 	{
 		/* Skip null array items */
 		if (isnull) continue;
@@ -412,12 +408,8 @@
 	** We need to convert the array of GSERIALIZED into a GEOS collection.
 	** First make an array of GEOS geometries.
 	*/
-#if POSTGIS_PGSQL_VERSION >= 95
 	iterator = array_create_iterator(array, 0, NULL);
-#else
-	iterator = array_create_iterator(array, 0);
-#endif
-	while( array_iterate(iterator, &value, &isnull) )
+	while (array_iterate(iterator, &value, &isnull))
 	{
 		GSERIALIZED *gser_in;
 
@@ -2673,19 +2665,11 @@
     Datum value;
     bool isnull;
     uint32_t nelems_not_null = 0;
-
-#if POSTGIS_PGSQL_VERSION >= 95
 	iterator = array_create_iterator(array, 0, NULL);
-#else
-	iterator = array_create_iterator(array, 0);
-#endif
 	while(array_iterate(iterator, &value, &isnull) )
-	{
         if (!isnull)
-        {
             nelems_not_null++;
-        }
-    }
+
     array_free_iterator(iterator);
 
     return nelems_not_null;
@@ -2702,42 +2686,36 @@
 
 	LWGEOM** lw_geoms = palloc(nelems * sizeof(LWGEOM*));
 
-#if POSTGIS_PGSQL_VERSION >= 95
     iterator = array_create_iterator(array, 0, NULL);
-#else
-    iterator = array_create_iterator(array, 0);
-#endif
 
-	while(array_iterate(iterator, &value, &isnull))
-	{
-		GSERIALIZED *geom = (GSERIALIZED*) DatumGetPointer(value);
+    while (array_iterate(iterator, &value, &isnull))
+    {
+	    GSERIALIZED *geom = (GSERIALIZED *)DatumGetPointer(value);
 
-        if (isnull)
-        {
-            continue;
-        }
+	    if (isnull)
+		    continue;
 
-		*is3d = *is3d || gserialized_has_z(geom);
+	    *is3d = *is3d || gserialized_has_z(geom);
 
-		lw_geoms[i] = lwgeom_from_gserialized(geom);
-		if (!lw_geoms[i]) /* error in creation */
-		{
-			lwpgerror("Geometry deserializing geometry");
-			return NULL;
-		}
-		if (!gotsrid)
-		{
-            gotsrid = true;
-			*srid = gserialized_get_srid(geom);
-		}
-		else if (*srid != gserialized_get_srid(geom))
-		{
-            error_if_srid_mismatch(*srid, gserialized_get_srid(geom));
-			return NULL;
-		}
+	    lw_geoms[i] = lwgeom_from_gserialized(geom);
+	    if (!lw_geoms[i]) /* error in creation */
+	    {
+		    lwpgerror("Geometry deserializing geometry");
+		    return NULL;
+	    }
+	    if (!gotsrid)
+	    {
+		    gotsrid = true;
+		    *srid = gserialized_get_srid(geom);
+	    }
+	    else if (*srid != gserialized_get_srid(geom))
+	    {
+		    error_if_srid_mismatch(*srid, gserialized_get_srid(geom));
+		    return NULL;
+	    }
 
-		i++;
-	}
+	    i++;
+    }
 
 	return lw_geoms;
 }
@@ -2753,11 +2731,7 @@
 
 	GEOSGeometry** geos_geoms = palloc(nelems * sizeof(GEOSGeometry*));
 
-#if POSTGIS_PGSQL_VERSION >= 95
     iterator = array_create_iterator(array, 0, NULL);
-#else
-    iterator = array_create_iterator(array, 0);
-#endif
 
     while(array_iterate(iterator, &value, &isnull))
 	{
@@ -2764,9 +2738,7 @@
         GSERIALIZED *geom = (GSERIALIZED*) DatumGetPointer(value);
 
         if (isnull)
-        {
             continue;
-        }
 
 		*is3d = *is3d || gserialized_has_z(geom);
 

Modified: trunk/postgis/lwgeom_inout.c
===================================================================
--- trunk/postgis/lwgeom_inout.c	2018-12-01 21:22:42 UTC (rev 17094)
+++ trunk/postgis/lwgeom_inout.c	2018-12-03 09:03:57 UTC (rev 17095)
@@ -560,13 +560,8 @@
 	/* Loop through array and build a collection of geometry and */
 	/* a simple array of ids. If either side is NULL, skip it */
 
-#if POSTGIS_PGSQL_VERSION >= 95
 	iter_geoms = array_create_iterator(arr_geoms, 0, NULL);
 	iter_ids = array_create_iterator(arr_ids, 0, NULL);
-#else
-	iter_geoms = array_create_iterator(arr_geoms, 0);
-	iter_ids = array_create_iterator(arr_ids, 0);
-#endif
 
 	while( array_iterate(iter_geoms, &val_geom, &null_geom) &&
 	       array_iterate(iter_ids, &val_id, &null_id) )

Modified: trunk/postgis/mvt.c
===================================================================
--- trunk/postgis/mvt.c	2018-12-01 21:22:42 UTC (rev 17094)
+++ trunk/postgis/mvt.c	2018-12-03 09:03:57 UTC (rev 17095)
@@ -28,10 +28,7 @@
 #include "pgsql_compat.h"
 
 #ifdef HAVE_LIBPROTOBUF
-
-#if POSTGIS_PGSQL_VERSION >= 94
 #include "utils/jsonb.h"
-#endif
 
 #if POSTGIS_PGSQL_VERSION < 110
 /* See trac ticket #3867 */
@@ -339,13 +336,12 @@
 		char *tkey = TupleDescAttr(ctx->column_cache.tupdesc, i)->attname.data;
 
 		ctx->column_cache.column_oid[i] = typoid;
-#if POSTGIS_PGSQL_VERSION >= 94
+
 		if (typoid == JSONBOID)
 		{
 			ctx->column_cache.column_keys_index[i] = UINT32_MAX;
 			continue;
 		}
-#endif
 
 		if (ctx->geom_name == NULL)
 		{
@@ -726,7 +722,6 @@
 		k = cc.column_keys_index[i];
 		typoid = cc.column_oid[i];
 
-#if POSTGIS_PGSQL_VERSION >= 94
 		if (k == UINT32_MAX && typoid != JSONBOID)
 			elog(ERROR, "parse_values: unexpectedly could not find parsed key name '%s'", key);
 		if (typoid == JSONBOID)
@@ -734,10 +729,6 @@
 			tags = parse_jsonb(ctx, DatumGetJsonbP(datum), tags);
 			continue;
 		}
-#else
-		if (k == UINT32_MAX)
-			elog(ERROR, "parse_values: unexpectedly could not find parsed key name '%s'", key);
-#endif
 
 		switch (typoid)
 		{

Modified: trunk/postgis/postgis.sql.in
===================================================================
--- trunk/postgis/postgis.sql.in	2018-12-01 21:22:42 UTC (rev 17094)
+++ trunk/postgis/postgis.sql.in	2018-12-03 09:03:57 UTC (rev 17095)
@@ -578,11 +578,7 @@
 -- Availability: 2.0.0
 CREATE OR REPLACE FUNCTION geometry_distance_centroid(geom1 geometry, geom2 geometry)
 	RETURNS float8
-#if POSTGIS_PGSQL_VERSION >= 95
 	AS 'MODULE_PATHNAME', 'ST_Distance'
-#else
-	AS 'MODULE_PATHNAME', 'gserialized_distance_centroid_2d'
-#endif
 	LANGUAGE 'c' IMMUTABLE STRICT _PARALLEL;
 
 -- Availability: 2.0.0

Modified: trunk/raster/rt_pg/rtpg_band_properties.c
===================================================================
--- trunk/raster/rt_pg/rtpg_band_properties.c	2018-12-01 21:22:42 UTC (rev 17094)
+++ trunk/raster/rt_pg/rtpg_band_properties.c	2018-12-03 09:03:57 UTC (rev 17095)
@@ -736,19 +736,21 @@
 			nulls[5] = TRUE;
 		}
 
-		if (bmd2[call_cntr].filesize) {
+		if (bmd2[call_cntr].filesize)
+		{
 #if POSTGIS_PGSQL_VERSION > 95
-                    values[6] = UInt64GetDatum(bmd2[call_cntr].filesize);
-                    values[7] = UInt64GetDatum(bmd2[call_cntr].timestamp);
+			values[6] = UInt64GetDatum(bmd2[call_cntr].filesize);
+			values[7] = UInt64GetDatum(bmd2[call_cntr].timestamp);
 #else /* POSTGIS_PGSQL_VERSION <= 95 */
-                    values[6] = Int64GetDatum(bmd2[call_cntr].filesize);
-                    values[7] = Int64GetDatum(bmd2[call_cntr].timestamp);
+			values[6] = Int64GetDatum(bmd2[call_cntr].filesize);
+			values[7] = Int64GetDatum(bmd2[call_cntr].timestamp);
 #endif
-                }
-                else {
-                    nulls[6] = TRUE;
-                    nulls[7] = TRUE;
-                }
+		}
+		else
+		{
+			nulls[6] = TRUE;
+			nulls[7] = TRUE;
+		}
 
 		/* build a tuple */
 		tuple = heap_form_tuple(tupdesc, values, nulls);

Modified: trunk/raster/rt_pg/rtpg_geometry.c
===================================================================
--- trunk/raster/rt_pg/rtpg_geometry.c	2018-12-01 21:22:42 UTC (rev 17094)
+++ trunk/raster/rt_pg/rtpg_geometry.c	2018-12-03 09:03:57 UTC (rev 17095)
@@ -37,10 +37,7 @@
 
 #include "../../postgis_config.h"
 
-#if POSTGIS_PGSQL_VERSION > 92
 #include "access/htup_details.h" /* for heap_form_tuple() */
-#endif
-
 #include "lwgeom_pg.h"
 
 #include "rtpostgis.h"

Modified: trunk/raster/rt_pg/rtpg_mapalgebra.c
===================================================================
--- trunk/raster/rt_pg/rtpg_mapalgebra.c	2018-12-01 21:22:42 UTC (rev 17094)
+++ trunk/raster/rt_pg/rtpg_mapalgebra.c	2018-12-03 09:03:57 UTC (rev 17095)
@@ -5754,11 +5754,7 @@
     }
 
     /* prep function call data */
-#if POSTGIS_PGSQL_VERSION <= 90
-    InitFunctionCallInfoData(cbdata, &cbinfo, 3, InvalidOid, NULL);
-#else
     InitFunctionCallInfoData(cbdata, &cbinfo, 3, InvalidOid, NULL, NULL);
-#endif
     memset(cbdata.argnull, FALSE, sizeof(bool) * 3);
 
     /* check that the function isn't strict if the args are null. */
@@ -6861,11 +6857,7 @@
 				}
 
 				/* prep function call data */
-#if POSTGIS_PGSQL_VERSION <= 90
-				InitFunctionCallInfoData(ufc_info, &ufl_info, ufl_info.fn_nargs, InvalidOid, NULL);
-#else
 				InitFunctionCallInfoData(ufc_info, &ufl_info, ufl_info.fn_nargs, InvalidOid, NULL, NULL);
-#endif
 				memset(ufc_info.argnull, FALSE, sizeof(bool) * ufl_info.fn_nargs);
 
 				if (ufl_info.fn_nargs != 4)

Modified: trunk/regress/core/Makefile.in
===================================================================
--- trunk/regress/core/Makefile.in	2018-12-01 21:22:42 UTC (rev 17094)
+++ trunk/regress/core/Makefile.in	2018-12-03 09:03:57 UTC (rev 17095)
@@ -23,7 +23,6 @@
 POSTGIS_MINOR_VERSION=@POSTGIS_MINOR_VERSION@
 HAVE_JSON=@HAVE_JSON@
 HAVE_PROTOBUF=@HAVE_PROTOBUF@
-HAVE_BRIN=@HAVE_BRIN@
 HAVE_SPGIST=@HAVE_SPGIST@
 INTERRUPTTESTS=@INTERRUPTTESTS@
 
@@ -86,11 +85,13 @@
 	forcecurve \
 	geography \
 	geometric_median \
+	hausdorff \
 	in_geohash \
 	in_gml \
 	in_kml \
 	in_encodedpolyline \
 	iscollection \
+	knn_recheck \
 	legacy \
 	long_xact \
 	lwgeom_regress \
@@ -107,6 +108,7 @@
 	quantize_coordinates \
 	regress \
 	regress_bdpoly \
+	regress_buffer_params \
 	regress_gist_index_nd \
 	regress_index \
 	regress_index_nulls \
@@ -137,43 +139,13 @@
 	swapordinates \
 	summary \
 	temporal \
+	temporal_knn \
 	tickets \
 	twkb \
 	typmod \
 	wkb \
 	wkt \
-	wmsservers
-
-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
-
-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
-endif
-
-
-TESTS += \
-	hausdorff \
-	regress_buffer_params
-
-
-ifeq ($(shell expr $(POSTGIS_GEOS_VERSION) ">=" 37),1)
-	# GEOS-3.7 adds:
-	# ST_FrechetDistance
-	TESTS += \
-		frechet
-endif
-
-
-# GEOS-3.3 adds:
-# ST_RelateMatch, ST_IsValidDetail, ST_SharedPaths ,
-# ST_Snap, ST_UnaryUnion, ST_MakeClean
-TESTS += \
+	wmsservers \
 	offsetcurve \
 	relatematch \
 	isvaliddetail \
@@ -182,13 +154,29 @@
 	node \
 	unaryunion \
 	clean \
-	relate_bnr
+	relate_bnr \
+	delaunaytriangles \
+	clipbybox2d \
+	subdivide \
+	voronoi \
+	regress_brin_index \
+	regress_brin_index_3d \
+	regress_brin_index_geography
 
-# GEOS-3.4 adds:
-# ST_DelaunayTriangles
-TESTS += \
-	delaunaytriangles
+ifeq ($(shell expr $(POSTGIS_GEOS_VERSION) ">=" 36),1)
+	# GEOS-3.6 adds:
+	# ST_MinimumClearance
+	TESTS += \
+		minimum_clearance \
+		oriented_envelope
+endif
 
+ifeq ($(shell expr $(POSTGIS_GEOS_VERSION) ">=" 37),1)
+	# GEOS-3.7 adds:
+	# ST_FrechetDistance
+	TESTS += \
+		frechet
+endif
 
 ifeq ($(INTERRUPTTESTS),yes)
 	# Allow CI servers to configure --with-interrupt-tests
@@ -198,24 +186,6 @@
 		interrupt_buffer
 endif
 
-
-ifeq ($(shell expr $(POSTGIS_GEOS_VERSION) ">=" 35),1)
-	# GEOS-3.5 adds:
-	# ST_ClipByBox2d, ST_Subdivide, ST_Voronoi
-	TESTS += \
-		clipbybox2d \
-		subdivide \
-		voronoi
-endif
-
-ifeq ($(shell expr $(POSTGIS_GEOS_VERSION) ">=" 36),1)
-	# GEOS-3.6 adds:
-	# ST_MinimumClearance
-	TESTS += \
-		minimum_clearance \
-		oriented_envelope
-endif
-
 ifeq ($(HAVE_JSON),yes)
 	# JSON-C adds:
 	# ST_GeomFromGeoJSON()
@@ -223,13 +193,6 @@
 		in_geojson
 endif
 
-ifeq ($(HAVE_BRIN),yes)
-	TESTS += \
-		regress_brin_index \
-		regress_brin_index_3d \
-		regress_brin_index_geography
-endif
-
 ifeq ($(HAVE_SPGIST),yes)
 	TESTS += \
 	regress_spgist_index_2d \
@@ -242,12 +205,9 @@
 	# ST_AsMVT, ST_AsGeobuf
 	TESTS += \
 		mvt \
-		geobuf
-ifeq ($(shell expr $(POSTGIS_PGSQL_VERSION) ">=" 94),1)
-	TESTS += \
+		geobuf \
 		mvt_jsonb
 endif
-endif
 
 all install uninstall:
 



More information about the postgis-tickets mailing list