From 9ca34e6790224fd00c65aff1c82cd91ca396455f Mon Sep 17 00:00:00 2001 From: Regina Obe Date: Fri, 26 May 2017 04:03:17 +0000 Subject: [PATCH] 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 git-svn-id: http://svn.osgeo.org/postgis/trunk@15402 b70326c6-7e19-0410-871a-916f4a2858ee --- configure.ac | 6 ++-- doc/extras_tigergeocoder.xml | 15 ++++++++- doc/postgis.xml | 6 ++-- postgis/Makefile.in | 8 ++--- postgis/lwgeom_accum.c | 4 --- postgis/lwgeom_backend_api.c | 2 -- postgis/lwgeom_dumppoints.c | 4 +-- postgis/lwgeom_functions_analytic.c | 5 +-- postgis/lwgeom_geos.c | 5 +-- postgis/lwgeom_inout.c | 4 +-- postgis/postgis.sql.in | 4 --- postgis/postgis_module.c | 4 --- raster/rt_pg/rtpg_band_properties.c | 4 +-- raster/rt_pg/rtpg_gdal.c | 4 +-- raster/rt_pg/rtpg_mapalgebra.c | 10 ++---- raster/rt_pg/rtpg_pixel.c | 4 +-- raster/rt_pg/rtpg_raster_properties.c | 4 +-- raster/rt_pg/rtpg_statistics.c | 4 +-- raster/rt_pg/rtpostgis.c | 6 ---- regress/Makefile.in | 46 ++++++++++++--------------- 20 files changed, 63 insertions(+), 86 deletions(-) diff --git a/configure.ac b/configure.ac index 661ca6be6..2e8ff10a7 100644 --- a/configure.ac +++ b/configure.ac @@ -455,9 +455,9 @@ if test "x$LIBLWGEOM_ONLY" = "xno"; then 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 diff --git a/doc/extras_tigergeocoder.xml b/doc/extras_tigergeocoder.xml index 75044ebce..3d8675287 100644 --- a/doc/extras_tigergeocoder.xml +++ b/doc/extras_tigergeocoder.xml @@ -966,6 +966,13 @@ CREATE INDEX idx_tiger_data_ma_faces_countyfp ON tiger_data.ma_faces USING btree parsed boolean - denotes if addess was formed from normalize process. The normalize_address function sets this to true before returning the address. + + + zip4 last 4 digits of a 9 digit zip code. Availability: PostGIS 2.4.0. + + + address_alphanumeric Full street number even if it has alpha characters like 17R. Parsing of this is better using function. Availability: PostGIS 2.4.0. + @@ -999,7 +1006,7 @@ CREATE INDEX idx_tiger_data_ma_faces_countyfp ON tiger_data.ma_faces USING btree - + Pagc_Normalize_Address @@ -1063,6 +1070,12 @@ CREATE INDEX idx_tiger_data_ma_faces_countyfp ON tiger_data.ma_faces USING btree parsed boolean - denotes if addess was formed from normalize process. The normalize_address function sets this to true before returning the address. + + zip4 last 4 digits of a 9 digit zip code. Availability PostGIS 2.4.0. + + + address_alphanumeric Full street number even if it has alpha characters like 17R or 12 1/2. Availability PostGIS 2.4.0. + diff --git a/doc/postgis.xml b/doc/postgis.xml index 5a2be9179..6208ab0da 100644 --- a/doc/postgis.xml +++ b/doc/postgis.xml @@ -4,7 +4,7 @@ - + @@ -12,8 +12,8 @@ - - + + diff --git a/postgis/Makefile.in b/postgis/Makefile.in index ee25399d2..12b102157 100644 --- a/postgis/Makefile.in +++ b/postgis/Makefile.in @@ -160,10 +160,10 @@ SHLIB_LINK := $(SHLIB_LINK_F) $(SHLIB_LINK) # 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 diff --git a/postgis/lwgeom_accum.c b/postgis/lwgeom_accum.c index 951c51a59..8ebba7e7a 100644 --- a/postgis/lwgeom_accum.c +++ b/postgis/lwgeom_accum.c @@ -386,13 +386,9 @@ PGISDirectFunctionCall1(PGFunction func, Datum arg1) 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; diff --git a/postgis/lwgeom_backend_api.c b/postgis/lwgeom_backend_api.c index 2f4ed4441..48adeea1b 100644 --- a/postgis/lwgeom_backend_api.c +++ b/postgis/lwgeom_backend_api.c @@ -146,9 +146,7 @@ void lwgeom_init_backend() (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 */ ); diff --git a/postgis/lwgeom_dumppoints.c b/postgis/lwgeom_dumppoints.c index 6a2519783..43ac19c0e 100644 --- a/postgis/lwgeom_dumppoints.c +++ b/postgis/lwgeom_dumppoints.c @@ -33,9 +33,9 @@ #include "../postgis_config.h" #include "lwgeom_pg.h" -#if POSTGIS_PGSQL_VERSION > 92 + #include "access/htup_details.h" -#endif + #include "liblwgeom.h" diff --git a/postgis/lwgeom_functions_analytic.c b/postgis/lwgeom_functions_analytic.c index 7d4ad951a..40d9cfa8b 100644 --- a/postgis/lwgeom_functions_analytic.c +++ b/postgis/lwgeom_functions_analytic.c @@ -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. diff --git a/postgis/lwgeom_geos.c b/postgis/lwgeom_geos.c index e7f30a7c4..7f36668b9 100644 --- a/postgis/lwgeom_geos.c +++ b/postgis/lwgeom_geos.c @@ -35,11 +35,8 @@ #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 */ diff --git a/postgis/lwgeom_inout.c b/postgis/lwgeom_inout.c index 61ad79f34..f87096c68 100644 --- a/postgis/lwgeom_inout.c +++ b/postgis/lwgeom_inout.c @@ -49,9 +49,9 @@ #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); diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in index ff2a87db3..67c53dfde 100644 --- a/postgis/postgis.sql.in +++ b/postgis/postgis.sql.in @@ -732,11 +732,9 @@ CREATE OPERATOR CLASS gist_geometry_ops_2d 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 @@ CREATE OPERATOR CLASS gist_geometry_ops_nd -- 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 @@ CREATE OPERATOR CLASS gist_geometry_ops_nd #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), diff --git a/postgis/postgis_module.c b/postgis/postgis_module.c index e107098c7..38b3c76ce 100644 --- a/postgis/postgis_module.c +++ b/postgis/postgis_module.c @@ -79,9 +79,7 @@ _PG_init(void) 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 @@ _PG_init(void) "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 */ ); diff --git a/raster/rt_pg/rtpg_band_properties.c b/raster/rt_pg/rtpg_band_properties.c index cc3bed13c..d1cb038ea 100644 --- a/raster/rt_pg/rtpg_band_properties.c +++ b/raster/rt_pg/rtpg_band_properties.c @@ -37,9 +37,9 @@ #include "../../postgis_config.h" -#if POSTGIS_PGSQL_VERSION > 92 + #include "access/htup_details.h" /* for heap_form_tuple() */ -#endif + #include "rtpostgis.h" diff --git a/raster/rt_pg/rtpg_gdal.c b/raster/rt_pg/rtpg_gdal.c index dbe8cdae9..daaf8cd14 100644 --- a/raster/rt_pg/rtpg_gdal.c +++ b/raster/rt_pg/rtpg_gdal.c @@ -37,9 +37,9 @@ #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" diff --git a/raster/rt_pg/rtpg_mapalgebra.c b/raster/rt_pg/rtpg_mapalgebra.c index 43d04fa9a..c0c8ca86d 100644 --- a/raster/rt_pg/rtpg_mapalgebra.c +++ b/raster/rt_pg/rtpg_mapalgebra.c @@ -836,11 +836,8 @@ Datum RASTER_nMapAlgebra(PG_FUNCTION_ARGS) 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 @@ Datum RASTER_mapAlgebraFct(PG_FUNCTION_ARGS) } /* 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. */ diff --git a/raster/rt_pg/rtpg_pixel.c b/raster/rt_pg/rtpg_pixel.c index 6689f2b47..e22c079a0 100644 --- a/raster/rt_pg/rtpg_pixel.c +++ b/raster/rt_pg/rtpg_pixel.c @@ -38,9 +38,9 @@ #include "lwgeom_pg.h" -#if POSTGIS_PGSQL_VERSION > 92 + #include "access/htup_details.h" /* for heap_form_tuple() */ -#endif + #include "rtpostgis.h" diff --git a/raster/rt_pg/rtpg_raster_properties.c b/raster/rt_pg/rtpg_raster_properties.c index 80f0ec272..3ab8fa45e 100644 --- a/raster/rt_pg/rtpg_raster_properties.c +++ b/raster/rt_pg/rtpg_raster_properties.c @@ -33,9 +33,9 @@ #include "../../postgis_config.h" -#if POSTGIS_PGSQL_VERSION > 92 + #include "access/htup_details.h" /* for heap_form_tuple() */ -#endif + #include "rtpostgis.h" diff --git a/raster/rt_pg/rtpg_statistics.c b/raster/rt_pg/rtpg_statistics.c index 95c509588..67a4ac651 100644 --- a/raster/rt_pg/rtpg_statistics.c +++ b/raster/rt_pg/rtpg_statistics.c @@ -39,9 +39,9 @@ #include "../../postgis_config.h" -#if POSTGIS_PGSQL_VERSION > 92 + #include "access/htup_details.h" /* for heap_form_tuple() */ -#endif + #include "rtpostgis.h" diff --git a/raster/rt_pg/rtpostgis.c b/raster/rt_pg/rtpostgis.c index 215fa6edd..543764c05 100644 --- a/raster/rt_pg/rtpostgis.c +++ b/raster/rt_pg/rtpostgis.c @@ -500,9 +500,7 @@ _PG_init(void) { 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 @@ _PG_init(void) { 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 @@ _PG_init(void) { 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 */ ); diff --git a/regress/Makefile.in b/regress/Makefile.in index 361bd3e40..1fb4fd6a1 100644 --- a/regress/Makefile.in +++ b/regress/Makefile.in @@ -145,27 +145,23 @@ TESTS = \ 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: @@ -174,21 +170,21 @@ ifeq ($(shell expr $(POSTGIS_GEOS_VERSION) ">=" 37),1) 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: -- 2.50.1