Skip to content

Commit 366d83f

Browse files
committed
Drop support for PostgreSQL 9.6 and 10
1 parent 137b703 commit 366d83f

11 files changed

+24
-104
lines changed

NEWS

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ PostGIS 3.3.0dev
22
2022/MM/DD
33

44
* Breaking changes *
5-
- ...
5+
- Drop support for PostgreSQL 9.6 and 10 (Regina Obe)
66

77
* Enhancements *
88
- postgis_extensions_upgrade() support for upgrades from any PostGIS

configure.ac

+4-7
Original file line numberDiff line numberDiff line change
@@ -496,15 +496,12 @@ if test "x$LIBLWGEOM_ONLY" = "xno"; then
496496
PGSQL_SHAREDIR=`"$PG_CONFIG" --sharedir`
497497

498498
AC_MSG_RESULT([checking PostgreSQL version... $PGSQL_FULL_VERSION])
499-
dnl Ensure that we are using PostgreSQL >= 9.6
500-
if test $POSTGIS_PGSQL_VERSION -lt 96; then
501-
AC_MSG_ERROR([PostGIS requires PostgreSQL >= 9.6])
499+
dnl Ensure that we are using PostgreSQL >= 11
500+
if test $POSTGIS_PGSQL_VERSION -lt 110; then
501+
AC_MSG_ERROR([PostGIS requires PostgreSQL >= 11])
502502
fi
503503

504-
HAVE_SPGIST=no
505-
if test $POSTGIS_PGSQL_VERSION -gt 100; then
506-
HAVE_SPGIST=yes
507-
fi
504+
HAVE_SPGIST=yes
508505

509506
dnl Note: We don't need the server-side LDFLAGS or CPPFLAGS because we get these from PGXS
510507

doc/postgis.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<!-- Change these values to update the version numbers referenced within the documentation -->
1414
<!ENTITY last_proj_release_version "8.2.1">
1515
<!ENTITY last_geos_release_version "3.10.1">
16-
<!ENTITY min_postgres_version "9.6">
16+
<!ENTITY min_postgres_version "11">
1717

1818
<!ENTITY introduction SYSTEM "introduction.xml">
1919
<!ENTITY installation SYSTEM "installation.xml">

libpgcommon/lwgeom_pg.c

-49
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@
3535

3636
#include "../postgis_config.h"
3737

38-
#if POSTGIS_PGSQL_VERSION >= 100
3938
#include <utils/regproc.h>
40-
#endif
4139

4240
#include "liblwgeom.h"
4341
#include "lwgeom_pg.h"
@@ -535,51 +533,6 @@ postgis_guc_find_option(const char *name)
535533
}
536534

537535

538-
#if POSTGIS_PGSQL_VERSION < 100
539-
Datum
540-
CallerFInfoFunctionCall1(PGFunction func, FmgrInfo *flinfo, Oid collation, Datum arg1)
541-
{
542-
FunctionCallInfoData fcinfo;
543-
Datum result;
544-
545-
InitFunctionCallInfoData(fcinfo, flinfo, 1, collation, NULL, NULL);
546-
547-
fcinfo.arg[0] = arg1;
548-
fcinfo.argnull[0] = false;
549-
550-
result = (*func) (&fcinfo);
551-
552-
/* Check for null result, since caller is clearly not expecting one */
553-
if (fcinfo.isnull)
554-
elog(ERROR, "function %p returned NULL", (void *) func);
555-
556-
return result;
557-
}
558-
559-
Datum
560-
CallerFInfoFunctionCall2(PGFunction func, FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2)
561-
{
562-
FunctionCallInfoData fcinfo;
563-
Datum result;
564-
565-
InitFunctionCallInfoData(fcinfo, flinfo, 2, collation, NULL, NULL);
566-
567-
fcinfo.arg[0] = arg1;
568-
fcinfo.arg[1] = arg2;
569-
fcinfo.argnull[0] = false;
570-
fcinfo.argnull[1] = false;
571-
572-
result = (*func) (&fcinfo);
573-
574-
/* Check for null result, since caller is clearly not expecting one */
575-
if (fcinfo.isnull)
576-
elog(ERROR, "function %p returned NULL", (void *) func);
577-
578-
return result;
579-
}
580-
581-
#else
582-
583536
#if POSTGIS_PGSQL_VERSION < 120
584537
Datum
585538
CallerFInfoFunctionCall3(PGFunction func, FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2, Datum arg3)
@@ -630,5 +583,3 @@ CallerFInfoFunctionCall3(PGFunction func, FmgrInfo *flinfo, Oid collation, Datum
630583
return result;
631584
}
632585
#endif
633-
634-
#endif

libpgcommon/lwgeom_pg.h

-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
#include "postgres.h"
1919
#include "fmgr.h"
2020
#include "catalog/namespace.h" /* For TypenameGetTypid */
21-
#if POSTGIS_PGSQL_VERSION > 100
2221
#include "catalog/pg_type_d.h" /* For TypenameGetTypid */
23-
#endif
2422
#include "utils/geo_decls.h"
2523
#include "utils/lsyscache.h"
2624
#include "utils/memutils.h"

postgis/geography.sql.in

-2
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,7 @@ CREATE OPERATOR CLASS gist_geography_ops
296296
FUNCTION 1 geography_gist_consistent (internal, geography, int4),
297297
FUNCTION 2 geography_gist_union (bytea, internal),
298298
FUNCTION 3 geography_gist_compress (internal),
299-
#if POSTGIS_PGSQL_VERSION < 110
300299
FUNCTION 4 geography_gist_decompress (internal),
301-
#endif
302300
FUNCTION 5 geography_gist_penalty (internal, internal, internal),
303301
FUNCTION 6 geography_gist_picksplit (internal, internal),
304302
FUNCTION 7 geography_gist_same (box2d, box2d, internal);

postgis/lwgeom_box3d.c

-2
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,6 @@ Datum BOX3D_construct(PG_FUNCTION_ARGS)
597597
}
598598

599599
/** needed for sp-gist support PostgreSQL 11+ **/
600-
#if POSTGIS_PGSQL_VERSION > 100
601600
/*****************************************************************************
602601
* BOX3D functions
603602
*****************************************************************************/
@@ -935,4 +934,3 @@ PGDLLEXPORT Datum BOX3D_distance(PG_FUNCTION_ARGS)
935934
BOX3D *box2 = PG_GETARG_BOX3D_P(1);
936935
PG_RETURN_FLOAT8(BOX3D_distance_internal(box1, box2));
937936
}
938-
#endif

postgis/lwgeom_box3d.h

-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ bool BOX3D_overback_internal(BOX3D *box1, BOX3D *box2);
6464
double BOX3D_distance_internal(BOX3D *box1, BOX3D *box2);
6565

6666
/** needed for sp-gist support PostgreSQL 11+ **/
67-
#if POSTGIS_PGSQL_VERSION > 100
6867
Datum BOX3D_contains(PG_FUNCTION_ARGS);
6968
Datum BOX3D_contained(PG_FUNCTION_ARGS);
7069
Datum BOX3D_overlaps(PG_FUNCTION_ARGS);
@@ -82,4 +81,3 @@ Datum BOX3D_overfront(PG_FUNCTION_ARGS);
8281
Datum BOX3D_back(PG_FUNCTION_ARGS);
8382
Datum BOX3D_overback(PG_FUNCTION_ARGS);
8483
Datum BOX3D_distance(PG_FUNCTION_ARGS);
85-
#endif

postgis/mvt.c

-5
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@
3636

3737
#include "lwgeom_wagyu.h"
3838

39-
#if POSTGIS_PGSQL_VERSION < 110
40-
/* See trac ticket #3867 */
41-
# define DatumGetJsonbP DatumGetJsonb
42-
#endif
43-
4439
#define uthash_fatal(msg) lwerror("uthash: fatal error (out of memory)")
4540
#define uthash_malloc(sz) palloc(sz)
4641
#define uthash_free(ptr,sz) pfree(ptr)

postgis/postgis.sql.in

+18-30
Original file line numberDiff line numberDiff line change
@@ -844,9 +844,7 @@ CREATE OPERATOR CLASS gist_geometry_ops_2d
844844
FUNCTION 1 geometry_gist_consistent_2d (internal, geometry, int4),
845845
FUNCTION 2 geometry_gist_union_2d (bytea, internal),
846846
FUNCTION 3 geometry_gist_compress_2d (internal),
847-
#if POSTGIS_PGSQL_VERSION < 110
848847
FUNCTION 4 geometry_gist_decompress_2d (internal),
849-
#endif
850848
FUNCTION 5 geometry_gist_penalty_2d (internal, internal, internal),
851849
FUNCTION 6 geometry_gist_picksplit_2d (internal, internal),
852850
FUNCTION 7 geometry_gist_same_2d (geom1 geometry, geom2 geometry, internal);
@@ -1031,9 +1029,8 @@ CREATE OPERATOR CLASS gist_geometry_ops_nd
10311029
FUNCTION 1 geometry_gist_consistent_nd (internal, geometry, int4),
10321030
FUNCTION 2 geometry_gist_union_nd (bytea, internal),
10331031
FUNCTION 3 geometry_gist_compress_nd (internal),
1034-
#if POSTGIS_PGSQL_VERSION < 110
1032+
-- Changed: 3.3.0
10351033
FUNCTION 4 geometry_gist_decompress_nd (internal),
1036-
#endif
10371034
FUNCTION 5 geometry_gist_penalty_nd (internal, internal, internal),
10381035
FUNCTION 6 geometry_gist_picksplit_nd (internal, internal),
10391036
FUNCTION 7 geometry_gist_same_nd (geometry, geometry, internal);
@@ -4966,10 +4963,8 @@ CREATE AGGREGATE ST_AsMVT(anyelement)
49664963
serialfunc = pgis_asmvt_serialfn,
49674964
deserialfunc = pgis_asmvt_deserialfn,
49684965
combinefunc = pgis_asmvt_combinefn,
4969-
finalfunc = pgis_asmvt_finalfn
4970-
#if POSTGIS_PGSQL_VERSION >= 110
4971-
,finalfunc_modify = read_write
4972-
#endif
4966+
finalfunc = pgis_asmvt_finalfn,
4967+
finalfunc_modify = read_write
49734968
);
49744969

49754970
-- Availability: 2.4.0
@@ -4983,12 +4978,11 @@ CREATE AGGREGATE ST_AsMVT(anyelement, text)
49834978
deserialfunc = pgis_asmvt_deserialfn,
49844979
combinefunc = pgis_asmvt_combinefn,
49854980
finalfunc = pgis_asmvt_finalfn
4986-
#if POSTGIS_PGSQL_VERSION >= 110
49874981
,finalfunc_modify = read_write
4988-
#endif
49894982
);
49904983

49914984
-- Availability: 2.4.0
4985+
-- Changed: 3.3.0
49924986
-- Changed: 3.2.0
49934987
CREATE AGGREGATE ST_AsMVT(anyelement, text, int4)
49944988
(
@@ -4998,13 +4992,12 @@ CREATE AGGREGATE ST_AsMVT(anyelement, text, int4)
49984992
serialfunc = pgis_asmvt_serialfn,
49994993
deserialfunc = pgis_asmvt_deserialfn,
50004994
combinefunc = pgis_asmvt_combinefn,
5001-
finalfunc = pgis_asmvt_finalfn
5002-
#if POSTGIS_PGSQL_VERSION >= 110
5003-
,finalfunc_modify = read_write
5004-
#endif
4995+
finalfunc = pgis_asmvt_finalfn,
4996+
finalfunc_modify = read_write
50054997
);
50064998

50074999
-- Availability: 2.4.0
5000+
-- Changed: 3.3.0
50085001
-- Changed: 3.2.0
50095002
CREATE AGGREGATE ST_AsMVT(anyelement, text, int4, text)
50105003
(
@@ -5014,13 +5007,12 @@ CREATE AGGREGATE ST_AsMVT(anyelement, text, int4, text)
50145007
serialfunc = pgis_asmvt_serialfn,
50155008
deserialfunc = pgis_asmvt_deserialfn,
50165009
combinefunc = pgis_asmvt_combinefn,
5017-
finalfunc = pgis_asmvt_finalfn
5018-
#if POSTGIS_PGSQL_VERSION >= 110
5019-
,finalfunc_modify = read_write
5020-
#endif
5010+
finalfunc = pgis_asmvt_finalfn,
5011+
finalfunc_modify = read_write
50215012
);
50225013

50235014
-- Availability: 3.0.0
5015+
-- Changed: 3.3.0
50245016
-- Changed: 3.2.0
50255017
CREATE AGGREGATE ST_AsMVT(anyelement, text, int4, text, text)
50265018
(
@@ -5030,10 +5022,8 @@ CREATE AGGREGATE ST_AsMVT(anyelement, text, int4, text, text)
50305022
serialfunc = pgis_asmvt_serialfn,
50315023
deserialfunc = pgis_asmvt_deserialfn,
50325024
combinefunc = pgis_asmvt_combinefn,
5033-
finalfunc = pgis_asmvt_finalfn
5034-
#if POSTGIS_PGSQL_VERSION >= 110
5035-
,finalfunc_modify = read_write
5036-
#endif
5025+
finalfunc = pgis_asmvt_finalfn,
5026+
finalfunc_modify = read_write
50375027
);
50385028

50395029
-- Availability: 2.4.0
@@ -5127,27 +5117,25 @@ CREATE OR REPLACE FUNCTION pgis_asflatgeobuf_finalfn(internal)
51275117
_COST_MEDIUM;
51285118

51295119
-- Availability: 3.2.0
5120+
-- Changed: 3.3.0
51305121
CREATE AGGREGATE ST_AsFlatGeobuf(anyelement)
51315122
(
51325123
sfunc = pgis_asflatgeobuf_transfn,
51335124
stype = internal,
51345125
parallel = safe,
5135-
finalfunc = pgis_asflatgeobuf_finalfn
5136-
#if POSTGIS_PGSQL_VERSION >= 110
5137-
,finalfunc_modify = read_write
5138-
#endif
5126+
finalfunc = pgis_asflatgeobuf_finalfn,
5127+
finalfunc_modify = read_write
51395128
);
51405129

51415130
-- Availability: 3.2.0
5131+
-- Changed: 3.3.0
51425132
CREATE AGGREGATE ST_AsFlatGeobuf(anyelement, bool)
51435133
(
51445134
sfunc = pgis_asflatgeobuf_transfn,
51455135
stype = internal,
51465136
parallel = safe,
5147-
finalfunc = pgis_asflatgeobuf_finalfn
5148-
#if POSTGIS_PGSQL_VERSION >= 110
5149-
,finalfunc_modify = read_write
5150-
#endif
5137+
finalfunc = pgis_asflatgeobuf_finalfn,
5138+
finalfunc_modify = read_write
51515139
);
51525140

51535141
-- Availability: 3.2.0

postgis/postgis_spgist.sql.in

-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "sqldefines.h"
2-
#if POSTGIS_PGSQL_VERSION > 100
32
-- ---------- ---------- ---------- ---------- ---------- ---------- ----------
43
-- SP-GiST 2D Support Functions
54
-- ---------- ---------- ---------- ---------- ---------- ---------- ----------
@@ -265,5 +264,3 @@ CREATE OPERATOR CLASS spgist_geography_ops_nd
265264
FUNCTION 4 geography_spgist_inner_consistent_nd(internal, internal),
266265
FUNCTION 5 geography_spgist_leaf_consistent_nd(internal, internal),
267266
FUNCTION 6 geography_spgist_compress_nd(internal);
268-
269-
#endif

0 commit comments

Comments
 (0)