[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0rc2-25-g3e38e0b83

git at osgeo.org git at osgeo.org
Fri Sep 2 17:15:03 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  3e38e0b83b98925122bb22dff958a7a603ee4a42 (commit)
      from  2428842e84fc6b6ce8a15fcfe9a17d888cd0eaa5 (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 3e38e0b83b98925122bb22dff958a7a603ee4a42
Author: Regina Obe <lr at pcorp.us>
Date:   Fri Sep 2 19:56:48 2022 -0400

    Remove support for PostgreSQL < 12
    Remove support for Proj < 6.1
    Closes #5229 for PostGIS 3.4.0

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 455204ae8..604b4a4c0 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -21,7 +21,7 @@ jobs:
         - { tag: pg15-clang-geos311-gdal35-proj90, mode: usan_clang }
         # - { tag: pg13-geos39-gdal31-proj71, mode: garden }
         - { tag: pg14-geos39-gdal33-proj71, mode: tests }
-        - { tag: pg14-clang-geosmain-gdal34-proj71, mode: usan_clang }
+        - { tag: pg14-clang-geos310-gdal34-proj71, mode: usan_clang }
         #- { tag: pg13-geos39-gdal31-proj71, mode: tests }
         #- { tag: pg13-geos39-gdal31-proj71, mode: coverage }
         - { tag: pg13-geos39-gdal31-proj71, mode: usan_gcc }
@@ -30,7 +30,7 @@ jobs:
         # - { tag: latest, mode: tests }
         - { tag: pg13-geos38-gdal31-proj71, mode: tests }
         - { tag: pg12-geos37-gdal30-proj611, mode: tests }
-        - { tag: pg11-geos37-gdal24-proj52, mode: tests }
+        # - { tag: pg11-geos37-gdal24-proj52, mode: tests }
         # - { tag: pg10-geos36-gdal23-proj49, mode: tests }
         # - { tag: pg96-geos36-gdal22-proj49, mode: tests }
 
diff --git a/NEWS b/NEWS
index 6e2afc448..121188d7a 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,9 @@
 PostGIS 3.4.0dev
 xxxx/xx/xx
 
+* Breaking Changes *
+- #5229, Drop support for Proj < 6.1 and PG 11 (Regina Obe)
+
 PostGIS 3.3.0
 2022/08/26
 
diff --git a/configure.ac b/configure.ac
index 98dcc3fd2..764e3c51a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -505,9 +505,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 >= 11
-  if test $POSTGIS_PGSQL_VERSION -lt 110; then
-    AC_MSG_ERROR([PostGIS requires PostgreSQL >= 11])
+  dnl Ensure that we are using PostgreSQL >= 12
+  if test $POSTGIS_PGSQL_VERSION -lt 120; then
+    AC_MSG_ERROR([PostGIS requires PostgreSQL >= 12])
   fi
 
   HAVE_SPGIST=yes
@@ -925,9 +925,9 @@ AC_DEFINE_UNQUOTED([POSTGIS_PROJ_VERSION], [$POSTGIS_PROJ_VERSION], [PROJ librar
 AC_SUBST([POSTGIS_PROJ_VERSION])
 CPPFLAGS="$CPPFLAGS_SAVE"
 
-dnl Ensure that we are using PROJ >= 4.9.0 (requires pj_set_searchpath)
-if test ! "$POSTGIS_PROJ_VERSION" -ge 49; then
-	AC_MSG_ERROR([PostGIS requires PROJ >= 4.9.0])
+dnl Ensure that we are using PROJ >= 6.1.0 (requires pj_set_searchpath)
+if test ! "$POSTGIS_PROJ_VERSION" -ge 61; then
+	AC_MSG_ERROR([PostGIS requires PROJ >= 6.1.0])
 fi
 
 AC_SUBST([PROJ_CPPFLAGS])
diff --git a/doc/postgis.xml b/doc/postgis.xml
index b47f7c893..70a4c2784 100644
--- a/doc/postgis.xml
+++ b/doc/postgis.xml
@@ -4,7 +4,7 @@
 
 <!-- This value is automatically generated by the Makefile -->
 <!ENTITY last_release_version "@@LAST_RELEASE_VERSION@@">
-<!ENTITY last_minor_version "3.2">
+<!ENTITY last_minor_version "3.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 -->
@@ -13,7 +13,7 @@
 <!-- Change these values to update the version numbers referenced within the documentation -->
 <!ENTITY last_proj_release_version "9.0.1">
 <!ENTITY last_geos_release_version "3.11.0">
-<!ENTITY min_postgres_version "11">
+<!ENTITY min_postgres_version "12">
 <!ENTITY max_postgres_version "15">
 
 <!ENTITY introduction SYSTEM "introduction.xml">
diff --git a/liblwgeom/liblwgeom.h.in b/liblwgeom/liblwgeom.h.in
index 7ffffa8a7..e696d56de 100644
--- a/liblwgeom/liblwgeom.h.in
+++ b/liblwgeom/liblwgeom.h.in
@@ -35,21 +35,6 @@
 
 #include "../postgis_config.h"
 
-#if POSTGIS_PROJ_VERSION < 61
-
-/* For Proj 6.0 use of old API */
-#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
-
-#include "proj_api.h"
-typedef struct PJ
-{
-    projPJ pj_from;
-    projPJ pj_to;
-} PJ;
-
-typedef PJ LWPROJ;
-
-#else
 #include "proj.h"
 
 /* For PROJ6 we cache several extra values to avoid calls to proj_get_source_crs
@@ -64,15 +49,11 @@ typedef struct LWPROJ
     double source_semi_major_metre;
     double source_semi_minor_metre;
 } LWPROJ;
-#endif
 
-#if POSTGIS_PROJ_VERSION < 49
-/* Use the old (pre-2.2) geodesic functions */
-#undef PROJ_GEODESIC
-#else
+
+
 /* Enable new geodesic functions API */
 #define PROJ_GEODESIC
-#endif
 
 /**
 * @file liblwgeom.h
@@ -2460,16 +2441,6 @@ int lwgeom_transform_from_str(LWGEOM *geom, const char* instr, const char* outst
 int lwgeom_transform(LWGEOM *geom, LWPROJ* pj);
 int ptarray_transform(POINTARRAY *pa, LWPROJ* pj);
 
-#if POSTGIS_PROJ_VERSION < 61
-/**
- * Get a projection from a string representation
- *
- * Eg: "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"
- */
-projPJ projpj_from_string(const char* txt);
-
-#else // POSTGIS_PROJ_VERSION >= 61
-
 /**
  * Allocate a new LWPROJ containing the reference to the PROJ's PJ
  * If extra_geography_data is true, it will generate the following values for
@@ -2477,9 +2448,6 @@ projPJ projpj_from_string(const char* txt);
  */
 LWPROJ *lwproj_from_str(const char* str_in, const char* str_out);
 
-#endif
-
-
 /*******************************************************************************
  * GEOS-dependent extra functions on LWGEOM
  ******************************************************************************/
diff --git a/liblwgeom/lwgeom_transform.c b/liblwgeom/lwgeom_transform.c
index e9bc859c9..d761293bf 100644
--- a/liblwgeom/lwgeom_transform.c
+++ b/liblwgeom/lwgeom_transform.c
@@ -46,112 +46,6 @@ to_dec(POINT4D *pt)
 
 /***************************************************************************/
 
-#if POSTGIS_PROJ_VERSION < 61
-
-static int
-point4d_transform(POINT4D *pt, LWPROJ *pj)
-{
-	POINT3D orig_pt = {pt->x, pt->y, pt->z}; /* Copy for error report*/
-
-	if (pj_is_latlong(pj->pj_from)) to_rad(pt) ;
-
-	LWDEBUGF(4, "transforming POINT(%f %f) from '%s' to '%s'",
-		 orig_pt.x, orig_pt.y, pj_get_def(pj->pj_from,0), pj_get_def(pj->pj_to,0));
-
-	if (pj_transform(pj->pj_from, pj->pj_to, 1, 0, &(pt->x), &(pt->y), &(pt->z)) != 0)
-	{
-		int pj_errno_val = *pj_get_errno_ref();
-		if (pj_errno_val == -38)
-		{
-			lwnotice("PostGIS was unable to transform the point because either no grid"
-				 " shift files were found, or the point does not lie within the "
-				 "range for which the grid shift is defined. Refer to the "
-				 "ST_Transform() section of the PostGIS manual for details on how "
-				 "to configure PostGIS to alter this behaviour.");
-			lwerror("transform: couldn't project point (%g %g %g): %s (%d)",
-				orig_pt.x, orig_pt.y, orig_pt.z,
-				pj_strerrno(pj_errno_val), pj_errno_val);
-		}
-		else
-		{
-			lwerror("transform: %s (%d)",
-				pj_strerrno(pj_errno_val), pj_errno_val);
-		}
-		return LW_FAILURE;
-	}
-
-	if (pj_is_latlong(pj->pj_to)) to_dec(pt);
-	return LW_SUCCESS;
-}
-
-/**
- * Transform given POINTARRAY
- * from inpj projection to outpj projection
- */
-int
-ptarray_transform(POINTARRAY *pa, LWPROJ *pj)
-{
-	uint32_t i;
-	POINT4D p;
-
-	for ( i = 0; i < pa->npoints; i++ )
-	{
-		getPoint4d_p(pa, i, &p);
-		if ( ! point4d_transform(&p, pj) ) return LW_FAILURE;
-		ptarray_set_point4d(pa, i, &p);
-	}
-
-	return LW_SUCCESS;
-}
-
-int
-lwgeom_transform_from_str(LWGEOM *geom, const char* instr, const char* outstr)
-{
-	char *pj_errstr;
-	int rv;
-	LWPROJ pj;
-
-	pj.pj_from = projpj_from_string(instr);
-	if (!pj.pj_from)
-	{
-		pj_errstr = pj_strerrno(*pj_get_errno_ref());
-		if (!pj_errstr) pj_errstr = "";
-		lwerror("could not parse proj string '%s'", instr);
-		return LW_FAILURE;
-	}
-
-	pj.pj_to = projpj_from_string(outstr);
-	if (!pj.pj_to)
-	{
-		pj_free(pj.pj_from);
-		pj_errstr = pj_strerrno(*pj_get_errno_ref());
-		if (!pj_errstr) pj_errstr = "";
-		lwerror("could not parse proj string '%s'", outstr);
-		return LW_FAILURE;
-	}
-
-	rv = lwgeom_transform(geom, &pj);
-	pj_free(pj.pj_from);
-	pj_free(pj.pj_to);
-	return rv;
-}
-
-
-
-projPJ
-projpj_from_string(const char *str1)
-{
-	if (!str1 || str1[0] == '\0')
-	{
-		return NULL;
-	}
-	return pj_init_plus(str1);
-}
-
-/***************************************************************************/
-
-#else /* POSTGIS_PROJ_VERION >= 61 */
-
 LWPROJ *
 lwproj_from_str(const char* str_in, const char* str_out)
 {
@@ -346,8 +240,6 @@ ptarray_transform(POINTARRAY *pa, LWPROJ *pj)
 	return LW_SUCCESS;
 }
 
-#endif
-
 /**
  * Transform given LWGEOM geometry
  * from inpj projection to outpj projection
diff --git a/libpgcommon/lwgeom_pg.c b/libpgcommon/lwgeom_pg.c
index ce8c05543..e1724548b 100644
--- a/libpgcommon/lwgeom_pg.c
+++ b/libpgcommon/lwgeom_pg.c
@@ -55,9 +55,7 @@ postgisConstants *POSTGIS_CONSTANTS = NULL;
 static Oid TypenameNspGetTypid(const char *typname, Oid nsp_oid)
 {
 	return GetSysCacheOid2(TYPENAMENSP,
-#if POSTGIS_PGSQL_VERSION >= 120
 	                       Anum_pg_type_oid,
-#endif
 	                       PointerGetDatum(typname),
 	                       ObjectIdGetDatum(nsp_oid));
 }
@@ -75,19 +73,11 @@ postgis_get_extension_schema(Oid ext_oid)
     HeapTuple   tuple;
     ScanKeyData entry[1];
 
-#if POSTGIS_PGSQL_VERSION < 120
-    Relation rel = heap_open(ExtensionRelationId, AccessShareLock);
-    ScanKeyInit(&entry[0],
-	    ObjectIdAttributeNumber,
-        BTEqualStrategyNumber, F_OIDEQ,
-        ObjectIdGetDatum(ext_oid));
-#else
     Relation rel = table_open(ExtensionRelationId, AccessShareLock);
     ScanKeyInit(&entry[0],
     	Anum_pg_extension_oid,
         BTEqualStrategyNumber, F_OIDEQ,
         ObjectIdGetDatum(ext_oid));
-#endif /* POSTGIS_PGSQL_VERSION */
 
     scandesc = systable_beginscan(rel, ExtensionOidIndexId, true,
                                   NULL, 1, entry);
@@ -102,11 +92,7 @@ postgis_get_extension_schema(Oid ext_oid)
 
     systable_endscan(scandesc);
 
-#if POSTGIS_PGSQL_VERSION < 120
-    heap_close(rel, AccessShareLock);
-#else
     table_close(rel, AccessShareLock);
-#endif
 
     return result;
 }
@@ -533,31 +519,6 @@ postgis_guc_find_option(const char *name)
 }
 
 
-#if POSTGIS_PGSQL_VERSION < 120
-Datum
-CallerFInfoFunctionCall3(PGFunction func, FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2, Datum arg3)
-{
-	FunctionCallInfoData fcinfo;
-	Datum		result;
-
-	InitFunctionCallInfoData(fcinfo, flinfo, 3, collation, NULL, NULL);
-
-	fcinfo.arg[0] = arg1;
-	fcinfo.arg[1] = arg2;
-	fcinfo.arg[2] = arg3;
-	fcinfo.argnull[0] = false;
-	fcinfo.argnull[1] = false;
-	fcinfo.argnull[2] = false;
-
-	result = (*func) (&fcinfo);
-
-	/* Check for null result, since caller is clearly not expecting one */
-	if (fcinfo.isnull)
-		elog(ERROR, "function %p returned NULL", (void *) func);
-
-	return result;
-}
-#else
 /* PgSQL 12+ still lacks 3-argument version of these functions */
 Datum
 CallerFInfoFunctionCall3(PGFunction func, FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2, Datum arg3)
@@ -582,4 +543,3 @@ CallerFInfoFunctionCall3(PGFunction func, FmgrInfo *flinfo, Oid collation, Datum
 
     return result;
 }
-#endif
diff --git a/libpgcommon/lwgeom_pg.h b/libpgcommon/lwgeom_pg.h
index d14937028..51ffe77cb 100644
--- a/libpgcommon/lwgeom_pg.h
+++ b/libpgcommon/lwgeom_pg.h
@@ -253,10 +253,6 @@ void lwpgerror(const char *fmt, ...);
 void lwpgnotice(const char *fmt, ...);
 void lwpgwarning(const char *fmt, ...);
 
-#if POSTGIS_PGSQL_VERSION < 100
-Datum CallerFInfoFunctionCall1(PGFunction func, FmgrInfo *flinfo, Oid collation, Datum arg1);
-Datum CallerFInfoFunctionCall2(PGFunction func, FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2);
-#endif
 Datum CallerFInfoFunctionCall3(PGFunction func, FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2, Datum arg3);
 
 
diff --git a/libpgcommon/lwgeom_transform.c b/libpgcommon/lwgeom_transform.c
index 3972b914c..95394bddb 100644
--- a/libpgcommon/lwgeom_transform.c
+++ b/libpgcommon/lwgeom_transform.c
@@ -67,25 +67,12 @@ static void
 PROJSRSDestroyPJ(void *projection)
 {
 	LWPROJ *pj = (LWPROJ *)projection;
-#if POSTGIS_PROJ_VERSION < 61
-/* Ape the Proj 6+ API for versions < 6.1 */
-	if (pj->pj_from)
-	{
-		pj_free(pj->pj_from);
-		pj->pj_from = NULL;
-	}
-	if (pj->pj_to)
-	{
-		pj_free(pj->pj_to);
-		pj->pj_to = NULL;
-	}
-#else
+
 	if (pj->pj)
 	{
 		proj_destroy(pj->pj);
 		pj->pj = NULL;
 	}
-#endif
 }
 
 /**
@@ -361,7 +348,6 @@ pjstrs_pfree(PjStrs *strs)
 		pfree(strs->srtext);
 }
 
-#if POSTGIS_PROJ_VERSION >= 61
 static char*
 pgstrs_get_entry(const PjStrs *strs, int n)
 {
@@ -377,25 +363,6 @@ pgstrs_get_entry(const PjStrs *strs, int n)
 			return NULL;
 	}
 }
-#endif
-
-#if POSTGIS_PROJ_VERSION < 61
-/*
-* Utility function for GML reader that still
-* needs proj4text access
-*/
-char *
-GetProj4String(int32_t srid)
-{
-	PjStrs strs;
-	char *proj4str;
-	memset(&strs, 0, sizeof(strs));
-	strs = GetProjStringsSPI(srid);
-	proj4str = pstrdup(strs.proj4text);
-	pjstrs_pfree(&strs);
-	return proj4str;
-}
-#endif
 
 /**
  * Add an entry to the local PROJ SRS cache. If we need to wrap around then
@@ -423,23 +390,6 @@ AddToPROJSRSCache(PROJSRSCache *PROJCache, int32_t srid_from, int32_t srid_to)
 
 	oldContext = MemoryContextSwitchTo(PROJCache->PROJSRSCacheContext);
 
-#if POSTGIS_PROJ_VERSION < 61
-	PJ *projection = palloc(sizeof(PJ));
-	pj_from_str = from_strs.proj4text;
-	pj_to_str = to_strs.proj4text;
-	projection->pj_from = projpj_from_string(pj_from_str);
-	projection->pj_to = projpj_from_string(pj_to_str);
-
-	if (!projection->pj_from)
-		elog(ERROR,
-		    "could not form projection from 'srid=%d' to 'srid=%d'",
-		    srid_from, srid_to);
-
-	if (!projection->pj_to)
-		elog(ERROR,
-		    "could not form projection from 'srid=%d' to 'srid=%d'",
-		    srid_from, srid_to);
-#else
 
 	LWPROJ *projection = NULL;
 	/* Try combinations of AUTH_NAME:AUTH_SRID/SRTEXT/PROJ4TEXT until we find */
@@ -463,7 +413,6 @@ AddToPROJSRSCache(PROJSRSCache *PROJCache, int32_t srid_from, int32_t srid_to)
 		elog(ERROR, "could not form projection (LWPROJ) from 'srid=%d' to 'srid=%d'", srid_from, srid_to);
 		return NULL;
 	}
-#endif
 
 	/* If the cache is already full then find the least used element and delete it */
 	uint32_t cache_position = PROJCache->PROJSRSCacheCount;
@@ -555,11 +504,7 @@ lwproj_lookup(int32_t srid_from, int32_t srid_to, LWPROJ **pj)
 int
 lwproj_is_latlong(const LWPROJ *pj)
 {
-#if POSTGIS_PROJ_VERSION < 61
-	return pj_is_latlong(pj->pj_from);
-#else
 	return pj->source_is_latlong;
-#endif
 }
 
 static int
@@ -609,34 +554,13 @@ int
 spheroid_init_from_srid(int32_t srid, SPHEROID *s)
 {
 	LWPROJ *pj;
-#if POSTGIS_PROJ_VERSION >= 48 && POSTGIS_PROJ_VERSION < 61
-	double major_axis, minor_axis, eccentricity_squared;
-#endif
 
 	if ( lwproj_lookup(srid, srid, &pj) == LW_FAILURE)
 		return LW_FAILURE;
 
-#if POSTGIS_PROJ_VERSION >= 61
 	if (!pj->source_is_latlong)
 		return LW_FAILURE;
 	spheroid_init(s, pj->source_semi_major_metre, pj->source_semi_minor_metre);
 
-#elif POSTGIS_PROJ_VERSION >= 48
-	if (!pj_is_latlong(pj->pj_from))
-		return LW_FAILURE;
-	/* For newer versions of Proj we can pull the spheroid paramaeters and initialize */
-	/* using them */
-	pj_get_spheroid_defn(pj->pj_from, &major_axis, &eccentricity_squared);
-	minor_axis = major_axis * sqrt(1-eccentricity_squared);
-	spheroid_init(s, major_axis, minor_axis);
-
-#else
-	if (!pj_is_latlong(pj->pj_from))
-		return LW_FAILURE;
-	/* For old versions of Proj we cannot lookup the spheroid parameters from the API */
-	/* So we use the WGS84 parameters (boo!) */
-	spheroid_init(s, WGS84_MAJOR_AXIS, WGS84_MINOR_AXIS);
-#endif
-
 	return LW_SUCCESS;
 }
diff --git a/postgis/geography.sql.in b/postgis/geography.sql.in
index c48a4117d..f7e130074 100644
--- a/postgis/geography.sql.in
+++ b/postgis/geography.sql.in
@@ -798,8 +798,6 @@ CREATE OR REPLACE FUNCTION _ST_CoveredBy(geog1 geography, geog2 geography)
 	LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE
 	_COST_HIGH;
 
-#if POSTGIS_PGSQL_VERSION >= 120
-
 -- Availability: 1.5.0
 CREATE OR REPLACE FUNCTION ST_Covers(geog1 geography, geog2 geography)
 	RETURNS boolean
@@ -834,37 +832,6 @@ CREATE OR REPLACE FUNCTION ST_Intersects(geog1 geography, geog2 geography)
 	LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE
 	_COST_HIGH;
 
-#else /* POSTGIS_PGSQL_VERSION < 120 */
-
--- Only implemented for polygon-over-point
--- Availability: 1.5.0
-CREATE OR REPLACE FUNCTION ST_Covers(geog1 geography, geog2 geography)
-	RETURNS boolean
-	AS 'SELECT $1 OPERATOR(@extschema at .&&) $2 AND @extschema at ._ST_Covers($1, $2)'
-	LANGUAGE 'sql' IMMUTABLE PARALLEL SAFE;
-
--- Only implemented for polygon-over-point
--- Availability: 1.5.0
-CREATE OR REPLACE FUNCTION ST_CoveredBy(geog1 geography, geog2 geography)
-	RETURNS boolean
-	AS 'SELECT $1 OPERATOR(@extschema at .&&) $2 AND @extschema at ._ST_Covers($2, $1)'
-	LANGUAGE 'sql' IMMUTABLE PARALLEL SAFE;
-
--- Availability: 1.5.0
--- Changed: 3.0.0 to use default and named args
--- Replaces ST_DWithin(geography, geography, float8) deprecated in 3.0.0
-CREATE OR REPLACE FUNCTION ST_DWithin(geog1 geography, geog2 geography, tolerance float8, use_spheroid boolean DEFAULT true)
-	RETURNS boolean
-	AS 'SELECT $1 OPERATOR(@extschema at .&&) @extschema at ._ST_Expand($2,$3) AND $2 OPERATOR(@extschema at .&&) @extschema at ._ST_Expand($1,$3) AND @extschema at ._ST_DWithin($1, $2, $3, $4)'
-	LANGUAGE 'sql' IMMUTABLE PARALLEL SAFE;
-
-CREATE OR REPLACE FUNCTION ST_Intersects(geography, geography)
-	RETURNS boolean
-	AS 'SELECT $1 OPERATOR(@extschema at .&&) $2 AND @extschema at .ST_Distance($1, $2, false) < 0.00001'
-	LANGUAGE 'sql' IMMUTABLE PARALLEL SAFE;
-
-#endif /* POSTGIS_PGSQL_VERSION < 120 */
-
 -- Availability: 1.5.0 - this is just a hack to prevent unknown from causing ambiguous name because of geography
 CREATE OR REPLACE FUNCTION ST_Covers(text, text)
 	RETURNS boolean AS
diff --git a/postgis/gserialized_estimate.c b/postgis/gserialized_estimate.c
index 56c685dfc..b7bf3e6a0 100644
--- a/postgis/gserialized_estimate.c
+++ b/postgis/gserialized_estimate.c
@@ -908,28 +908,6 @@ pg_nd_stats_from_tuple(HeapTuple stats_tuple, int mode)
 	if ( mode == 2 ) stats_kind = STATISTIC_KIND_2D;
 
     /* Then read the geom status histogram from that */
-
-#if POSTGIS_PGSQL_VERSION < 100
-	{
-		float4 *floatptr;
-		int nvalues;
-
-		rv = get_attstatsslot(stats_tuple, 0, 0, stats_kind, InvalidOid,
-							NULL, NULL, NULL, &floatptr, &nvalues);
-
-		if ( ! rv ) {
-			POSTGIS_DEBUGF(2, "no slot of kind %d in stats tuple", stats_kind);
-			return NULL;
-		}
-
-		/* Clone the stats here so we can release the attstatsslot immediately */
-		nd_stats = palloc(sizeof(float) * nvalues);
-		memcpy(nd_stats, floatptr, sizeof(float) * nvalues);
-
-		/* Clean up */
-		free_attstatsslot(0, NULL, 0, floatptr, nvalues);
-	}
-#else /* PostgreSQL 10 or higher */
 	{
 		AttStatsSlot sslot;
 		rv = get_attstatsslot(&sslot, stats_tuple, stats_kind, InvalidOid,
@@ -945,8 +923,6 @@ pg_nd_stats_from_tuple(HeapTuple stats_tuple, int mode)
 
 		free_attstatsslot(&sslot);
 	}
-#endif
-
 	return nd_stats;
 }
 
diff --git a/postgis/gserialized_supportfn.c b/postgis/gserialized_supportfn.c
index 289d62a98..58f65dbd9 100644
--- a/postgis/gserialized_supportfn.c
+++ b/postgis/gserialized_supportfn.c
@@ -21,8 +21,6 @@
 
 #include "../postgis_config.h"
 
-#if POSTGIS_PGSQL_VERSION >= 120
-
 /* PostgreSQL */
 #include "postgres.h"
 #include "funcapi.h"
@@ -542,5 +540,3 @@ Datum postgis_index_supportfn(PG_FUNCTION_ARGS)
 
 	PG_RETURN_POINTER(ret);
 }
-
-#endif /* POSTGIS_PGSQL_VERSION >= 120 */
diff --git a/postgis/lwgeom_accum.c b/postgis/lwgeom_accum.c
index 4b4a688c7..4ec33c852 100644
--- a/postgis/lwgeom_accum.c
+++ b/postgis/lwgeom_accum.c
@@ -337,25 +337,6 @@ pgis_geometry_clusterwithin_finalfn(PG_FUNCTION_ARGS)
 Datum
 PGISDirectFunctionCall1(PGFunction func, Datum arg1)
 {
-#if POSTGIS_PGSQL_VERSION < 120
-	FunctionCallInfoData fcinfo;
-	Datum           result;
-
-
-	InitFunctionCallInfoData(fcinfo, NULL, 1, InvalidOid, NULL, NULL);
-
-
-	fcinfo.arg[0] = arg1;
-	fcinfo.argnull[0] = false;
-
-	result = (*func) (&fcinfo);
-
-	/* Check for null result, returning a "NULL" Datum if indicated */
-	if (fcinfo.isnull)
-		return (Datum) 0;
-
-	return result;
-#else
 	LOCAL_FCINFO(fcinfo, 1);
 	Datum result;
 
@@ -371,7 +352,6 @@ PGISDirectFunctionCall1(PGFunction func, Datum arg1)
 		return (Datum)0;
 
 	return result;
-#endif /* POSTGIS_PGSQL_VERSION < 120 */
 }
 
 /**
@@ -381,25 +361,6 @@ PGISDirectFunctionCall1(PGFunction func, Datum arg1)
 Datum
 PGISDirectFunctionCall2(PGFunction func, Datum arg1, Datum arg2)
 {
-#if POSTGIS_PGSQL_VERSION < 120
-	FunctionCallInfoData fcinfo;
-	Datum           result;
-
-	InitFunctionCallInfoData(fcinfo, NULL, 2, InvalidOid, NULL, NULL);
-
-	fcinfo.arg[0] = arg1;
-	fcinfo.arg[1] = arg2;
-	fcinfo.argnull[0] = false;
-	fcinfo.argnull[1] = false;
-
-	result = (*func) (&fcinfo);
-
-	/* Check for null result, returning a "NULL" Datum if indicated */
-	if (fcinfo.isnull)
-		return (Datum) 0;
-
-	return result;
-#else
 	LOCAL_FCINFO(fcinfo, 2);
 	Datum result;
 
@@ -417,5 +378,4 @@ PGISDirectFunctionCall2(PGFunction func, Datum arg1, Datum arg2)
 		return (Datum)0;
 
 	return result;
-#endif /* POSTGIS_PGSQL_VERSION < 120 */
 }
diff --git a/postgis/lwgeom_in_gml.c b/postgis/lwgeom_in_gml.c
index 32b66af59..6fe568eb6 100644
--- a/postgis/lwgeom_in_gml.c
+++ b/postgis/lwgeom_in_gml.c
@@ -112,13 +112,6 @@ Datum geom_from_gml(PG_FUNCTION_ARGS)
 	/* Zero for undefined */
 	root_srid = PG_GETARG_INT32(1);
 
-#if POSTGIS_PROJ_VERSION < 61
-	/* Internally lwgeom_from_gml calls gml_reproject_pa which, for PROJ before 6, called GetProj4String.
-	 * That function requires access to spatial_ref_sys, so in order to have it ready we need to ensure
-	 * the internal cache is initialized
-	 */
-	postgis_initialize_cache();
-#endif
 	lwgeom = lwgeom_from_gml(xml, xml_size);
 	if ( root_srid != SRID_UNKNOWN )
 		lwgeom->srid = root_srid;
@@ -303,39 +296,6 @@ static xmlNodePtr get_xlink_node(xmlNodePtr xnode)
  * Use Proj to reproject a given POINTARRAY
  */
 
-#if POSTGIS_PROJ_VERSION < 61
-
-static POINTARRAY *
-gml_reproject_pa(POINTARRAY *pa, int32_t srid_in, int32_t srid_out)
-{
-	LWPROJ pj;
-	char *text_in, *text_out;
-
-	if (srid_in == SRID_UNKNOWN) return pa; /* nothing to do */
-	if (srid_out == SRID_UNKNOWN) gml_lwpgerror("invalid GML representation", 3);
-
-	text_in = GetProj4String(srid_in);
-	text_out = GetProj4String(srid_out);
-
-	pj.pj_from = projpj_from_string(text_in);
-	pj.pj_to = projpj_from_string(text_out);
-
-	lwfree(text_in);
-	lwfree(text_out);
-
-	if ( ptarray_transform(pa, &pj) == LW_FAILURE )
-	{
-		elog(ERROR, "gml_reproject_pa: reprojection failed");
-	}
-
-	pj_free(pj.pj_from);
-	pj_free(pj.pj_to);
-
-	return pa;
-}
-
-#else /* POSTGIS_PROJ_VERSION >= 61 */
-
 static POINTARRAY *
 gml_reproject_pa(POINTARRAY *pa, int32_t epsg_in, int32_t epsg_out)
 {
@@ -374,9 +334,6 @@ gml_reproject_pa(POINTARRAY *pa, int32_t epsg_in, int32_t epsg_out)
 	return pa;
 }
 
-#endif /* POSTGIS_PROJ_VERSION */
-
-
 /**
  * Return 1 if the SRS definition from the authority has a GIS friendly order,
  * that is easting,northing. This is typically true for most projected CRS
diff --git a/postgis/lwgeom_transform.c b/postgis/lwgeom_transform.c
index 758e7996c..1f59b306e 100644
--- a/postgis/lwgeom_transform.c
+++ b/postgis/lwgeom_transform.c
@@ -152,13 +152,9 @@ Datum transform_geom(PG_FUNCTION_ARGS)
 PG_FUNCTION_INFO_V1(postgis_proj_version);
 Datum postgis_proj_version(PG_FUNCTION_ARGS)
 {
-#if POSTGIS_PROJ_VERSION < 61
-	const char *ver = pj_get_release();
-	text *result = cstring_to_text(ver);
-#else
+
 	PJ_INFO pji = proj_info();
 	text *result = 	cstring_to_text(pji.version);
-#endif
 	PG_RETURN_POINTER(result);
 }
 
diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in
index 2c69ac5d6..4acf5ff12 100644
--- a/postgis/postgis.sql.in
+++ b/postgis/postgis.sql.in
@@ -4577,107 +4577,6 @@ CREATE OR REPLACE FUNCTION ST_Equals(geom1 geometry, geom2 geometry)
 	LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE
 	_COST_HIGH;
 
-#else
-
--- Availability: 1.4.0
-CREATE OR REPLACE FUNCTION ST_LineCrossingDirection(line1 geometry, line2 geometry)
-	RETURNS integer AS
-	$$ SELECT CASE WHEN NOT $1 OPERATOR(@extschema at .&&) $2 THEN 0 ELSE @extschema at ._ST_LineCrossingDirection($1,$2) END $$
-	LANGUAGE 'sql' IMMUTABLE PARALLEL SAFE;
-
--- Availability: 1.2.2
-CREATE OR REPLACE FUNCTION ST_DWithin(geom1 geometry, geom2 geometry, float8)
-	RETURNS boolean
-	AS 'SELECT $1 OPERATOR(@extschema at .&&) @extschema at .ST_Expand($2,$3) AND $2 OPERATOR(@extschema at .&&) @extschema at .ST_Expand($1,$3) AND @extschema at ._ST_DWithin($1, $2, $3)'
-	LANGUAGE 'sql' IMMUTABLE PARALLEL SAFE;
-
--- Availability: 1.2.2
-CREATE OR REPLACE FUNCTION ST_Touches(geom1 geometry, geom2 geometry)
-	RETURNS boolean
-	AS 'SELECT $1 OPERATOR(@extschema at .&&) $2 AND @extschema at ._ST_Touches($1,$2)'
-	LANGUAGE 'sql' IMMUTABLE PARALLEL SAFE;
-
--- Availability: 1.2.2
-CREATE OR REPLACE FUNCTION ST_Intersects(geom1 geometry, geom2 geometry)
-	RETURNS boolean
-	AS 'SELECT $1 OPERATOR(@extschema at .&&) $2 AND @extschema at ._ST_Intersects($1,$2)'
-	LANGUAGE 'sql' IMMUTABLE PARALLEL SAFE;
-
--- Availability: 1.2.2
-CREATE OR REPLACE FUNCTION ST_Crosses(geom1 geometry, geom2 geometry)
-	RETURNS boolean
-	AS 'SELECT $1 OPERATOR(@extschema at .&&) $2 AND @extschema at ._ST_Crosses($1,$2)'
-	LANGUAGE 'sql' IMMUTABLE PARALLEL SAFE;
-
--- Availability: 1.2.2
-CREATE OR REPLACE FUNCTION ST_Contains(geom1 geometry, geom2 geometry)
-	RETURNS boolean
-	AS 'SELECT $1 OPERATOR(@extschema at .~) $2 AND @extschema at ._ST_Contains($1,$2)'
-	LANGUAGE 'sql' IMMUTABLE PARALLEL SAFE;
-
--- Availability: 1.2.2
-CREATE OR REPLACE FUNCTION ST_CoveredBy(geom1 geometry, geom2 geometry)
-	RETURNS boolean
-	AS 'SELECT $1 OPERATOR(@extschema at .@) $2 AND @extschema at ._ST_CoveredBy($1,$2)'
-	LANGUAGE 'sql' IMMUTABLE PARALLEL SAFE;
-
--- Availability: 1.2.2
-CREATE OR REPLACE FUNCTION ST_Covers(geom1 geometry, geom2 geometry)
-	RETURNS boolean
-	AS 'SELECT $1 OPERATOR(@extschema at .~) $2 AND @extschema at ._ST_Covers($1,$2)'
-	LANGUAGE 'sql' IMMUTABLE PARALLEL SAFE;
-
--- Availability: 1.4.0
-CREATE OR REPLACE FUNCTION ST_ContainsProperly(geom1 geometry, geom2 geometry)
-	RETURNS boolean
-	AS 'SELECT $1 OPERATOR(@extschema at .~) $2 AND @extschema at ._ST_ContainsProperly($1,$2)'
-	LANGUAGE 'sql' IMMUTABLE PARALLEL SAFE;
-
--- Availability: 1.2.2
-CREATE OR REPLACE FUNCTION ST_Within(geom1 geometry, geom2 geometry)
-	RETURNS boolean
-	AS 'SELECT $2 OPERATOR(@extschema at .~) $1 AND @extschema at ._ST_Contains($2,$1)'
-	LANGUAGE 'sql' IMMUTABLE PARALLEL SAFE;
-
--- Availability: 1.2.2
-CREATE OR REPLACE FUNCTION ST_Overlaps(geom1 geometry, geom2 geometry)
-	RETURNS boolean
-	AS 'SELECT $1 OPERATOR(@extschema at .&&) $2 AND @extschema at ._ST_Overlaps($1,$2)'
-	LANGUAGE 'sql' IMMUTABLE PARALLEL SAFE;
-
-CREATE OR REPLACE FUNCTION ST_DFullyWithin(geom1 geometry, geom2 geometry, float8)
-	RETURNS boolean
-	AS 'SELECT $1 OPERATOR(@extschema at .&&) @extschema at .ST_Expand($2,$3) AND $2 OPERATOR(@extschema at .&&) @extschema at .ST_Expand($1,$3) AND @extschema at ._ST_DFullyWithin(@extschema at .ST_ConvexHull($1), @extschema at .ST_ConvexHull($2), $3)'
-	LANGUAGE 'sql' IMMUTABLE PARALLEL SAFE;
-
-CREATE OR REPLACE FUNCTION ST_3DDWithin(geom1 geometry, geom2 geometry,float8)
-	RETURNS boolean
-	AS 'SELECT $1 OPERATOR(@extschema at .&&) @extschema at .ST_Expand($2,$3) AND $2 OPERATOR(@extschema at .&&) @extschema at .ST_Expand($1,$3) AND @extschema at ._ST_3DDWithin($1, $2, $3)'
-	LANGUAGE 'sql' IMMUTABLE PARALLEL SAFE;
-
-CREATE OR REPLACE FUNCTION ST_3DDFullyWithin(geom1 geometry, geom2 geometry,float8)
-	RETURNS boolean
-	AS 'SELECT $1 OPERATOR(@extschema at .&&) @extschema at .ST_Expand($2,$3) AND $2 OPERATOR(@extschema at .&&) @extschema at .ST_Expand($1,$3) AND @extschema at ._ST_3DDFullyWithin($1, $2, $3)'
-	LANGUAGE 'sql' IMMUTABLE PARALLEL SAFE;
-
-CREATE OR REPLACE FUNCTION ST_3DIntersects(geom1 geometry, geom2 geometry)
-	RETURNS boolean
-	AS 'SELECT $1 OPERATOR(@extschema at .&&) $2 AND @extschema at ._ST_3DIntersects($1, $2)'
-	LANGUAGE 'sql' IMMUTABLE PARALLEL SAFE;
-
-CREATE OR REPLACE FUNCTION ST_OrderingEquals(GeometryA geometry, GeometryB geometry)
-	RETURNS boolean
-	AS 'SELECT $1 OPERATOR(@extschema at .~=) $2 AND @extschema at ._ST_OrderingEquals($1, $2)'
-	LANGUAGE 'sql' IMMUTABLE PARALLEL SAFE;
-
--- Availability: 1.2.1
-CREATE OR REPLACE FUNCTION ST_Equals(geom1 geometry, geom2 geometry)
-	RETURNS boolean
-	AS 'SELECT $1 OPERATOR(@extschema at .~=) $2 AND @extschema at ._ST_Equals($1,$2)'
-	LANGUAGE 'sql' IMMUTABLE PARALLEL SAFE;
-
-#endif
-
 -----------------------------------------------------------------------------
 
 -- PostGIS equivalent function: IsValid(geometry)
diff --git a/raster/rt_pg/rtpg_mapalgebra.c b/raster/rt_pg/rtpg_mapalgebra.c
index 593f64856..8f278d5f5 100644
--- a/raster/rt_pg/rtpg_mapalgebra.c
+++ b/raster/rt_pg/rtpg_mapalgebra.c
@@ -86,16 +86,12 @@ typedef struct {
 	Oid ufc_noid;
 	Oid ufc_rettype;
 	FmgrInfo ufl_info;
-#if POSTGIS_PGSQL_VERSION < 120
-	FunctionCallInfoData ufc_info;
-#else
 	/* copied from LOCAL_FCINFO in fmgr.h */
 	union {
 		FunctionCallInfoBaseData fcinfo;
 		char fcinfo_data[SizeForFunctionCallInfo(FUNC_MAX_ARGS)]; /* Could be optimized */
 	} ufc_info_data;
 	FunctionCallInfo ufc_info;
-#endif
 } rtpg_nmapalgebra_callback_arg;
 
 #if defined(__clang__)
@@ -155,9 +151,8 @@ static rtpg_nmapalgebra_arg rtpg_nmapalgebra_arg_init() {
 	arg->cextent = NULL;
 	arg->mask = NULL;
 
-#if POSTGIS_PGSQL_VERSION >= 120
 	arg->callback.ufc_info = &(arg->callback.ufc_info_data.fcinfo);
-#endif
+
 	arg->callback.ufc_noid = InvalidOid;
 	arg->callback.ufc_rettype = InvalidOid;
 
@@ -491,30 +486,17 @@ static int rtpg_nmapalgebra_callback(
 	pfree(_pos);
 	pfree(_null);
 
-#if POSTGIS_PGSQL_VERSION < 120
-	callback->ufc_info.arg[0] = PointerGetDatum(mdValues);
-	callback->ufc_info.arg[1] = PointerGetDatum(mdPos);
-#else
 	callback->ufc_info->args[0].value = PointerGetDatum(mdValues);
 	callback->ufc_info->args[1].value = PointerGetDatum(mdPos);
-#endif
 
 	/* call user callback function */
-#if POSTGIS_PGSQL_VERSION < 120
-	datum = FunctionCallInvoke(&(callback->ufc_info));
-#else
 	datum = FunctionCallInvoke(callback->ufc_info);
-#endif
 	pfree(mdValues);
 	pfree(mdPos);
 
 	/* result is not null*/
-#if POSTGIS_PGSQL_VERSION < 120
-	if (!callback->ufc_info.isnull) {
-#else
 	if (!callback->ufc_info->isnull)
 	{
-#endif
 		switch (callback->ufc_rettype) {
 			case FLOAT8OID:
 				*value = DatumGetFloat8(datum);
@@ -871,11 +853,6 @@ 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 < 120
-		InitFunctionCallInfoData(arg->callback.ufc_info, &(arg->callback.ufl_info), arg->callback.ufl_info.fn_nargs, InvalidOid, NULL, NULL);
-
-		memset(arg->callback.ufc_info.argnull, FALSE, sizeof(bool) * arg->callback.ufl_info.fn_nargs);
-#else
 		InitFunctionCallInfoData(*(arg->callback.ufc_info),
 					 &(arg->callback.ufl_info),
 					 arg->callback.ufl_info.fn_nargs,
@@ -886,37 +863,19 @@ Datum RASTER_nMapAlgebra(PG_FUNCTION_ARGS)
 		arg->callback.ufc_info->args[0].isnull = FALSE;
 		arg->callback.ufc_info->args[1].isnull = FALSE;
 		arg->callback.ufc_info->args[2].isnull = FALSE;
-#endif
-
 		/* userargs (7) */
 		if (!PG_ARGISNULL(9))
-#if POSTGIS_PGSQL_VERSION < 120
-			arg->callback.ufc_info.arg[2] = PG_GETARG_DATUM(9);
-#else
 			arg->callback.ufc_info->args[2].value = PG_GETARG_DATUM(9);
-#endif
 		else {
       if (arg->callback.ufl_info.fn_strict) {
 				/* build and assign an empty TEXT array */
 				/* TODO: manually free the empty array? */
-#if POSTGIS_PGSQL_VERSION < 120
-				arg->callback.ufc_info.arg[2] = PointerGetDatum(
-					construct_empty_array(TEXTOID)
-				);
-				arg->callback.ufc_info.argnull[2] = FALSE;
-#else
 				arg->callback.ufc_info->args[2].value = PointerGetDatum(construct_empty_array(TEXTOID));
 				arg->callback.ufc_info->args[2].isnull = FALSE;
-#endif
       }
 			else {
-#if POSTGIS_PGSQL_VERSION < 120
-				arg->callback.ufc_info.arg[2] = (Datum) NULL;
-				arg->callback.ufc_info.argnull[2] = TRUE;
-#else
 				arg->callback.ufc_info->args[2].value = (Datum)NULL;
 				arg->callback.ufc_info->args[2].isnull = TRUE;
-#endif
 			}
 		}
 	}
@@ -5131,11 +5090,8 @@ Datum RASTER_mapAlgebraFct(PG_FUNCTION_ARGS)
     int ret = -1;
     Oid oid;
     FmgrInfo cbinfo;
-#if POSTGIS_PGSQL_VERSION < 120
-    FunctionCallInfoData cbdata;
-#else
     LOCAL_FCINFO(cbdata, FUNC_MAX_ARGS); /* Could be optimized */
-#endif
+
     Datum tmpnewval;
     char * strFromText = NULL;
     int k = 0;
@@ -5375,19 +5331,11 @@ Datum RASTER_mapAlgebraFct(PG_FUNCTION_ARGS)
     }
 
     /* prep function call data */
-#if POSTGIS_PGSQL_VERSION < 120
-    InitFunctionCallInfoData(cbdata, &cbinfo, 2, InvalidOid, NULL, NULL);
-
-    cbdata.argnull[0] = FALSE;
-    cbdata.argnull[1] = FALSE;
-    cbdata.argnull[2] = FALSE;
-#else
     InitFunctionCallInfoData(*cbdata, &cbinfo, 2, InvalidOid, NULL, NULL);
 
     cbdata->args[0].isnull = FALSE;
     cbdata->args[1].isnull = FALSE;
     cbdata->args[2].isnull = FALSE;
-#endif
 
     /* check that the function isn't strict if the args are null. */
     if (PG_ARGISNULL(4)) {
@@ -5401,20 +5349,11 @@ Datum RASTER_mapAlgebraFct(PG_FUNCTION_ARGS)
             PG_RETURN_NULL();
         }
 
-#if POSTGIS_PGSQL_VERSION < 120
-	cbdata.arg[k] = (Datum)NULL;
-        cbdata.argnull[k] = TRUE;
-#else
-	cbdata->args[k].value = (Datum)NULL;
-	cbdata->args[k].isnull = TRUE;
-#endif
+		cbdata->args[k].value = (Datum)NULL;
+		cbdata->args[k].isnull = TRUE;
     }
     else {
-#if POSTGIS_PGSQL_VERSION < 120
-	    cbdata.arg[k] = PG_GETARG_DATUM(4);
-#else
 	    cbdata->args[k].value = PG_GETARG_DATUM(4);
-#endif
     }
 
     /**
@@ -5491,22 +5430,12 @@ Datum RASTER_mapAlgebraFct(PG_FUNCTION_ARGS)
                         POSTGIS_RT_DEBUG(3, "RASTER_mapAlgebraFct: Strict callbacks cannot accept NULL arguments, skipping NODATA cell.");
                         continue;
                     }
-#if POSTGIS_PGSQL_VERSION < 120
-		    cbdata.argnull[0] = TRUE;
-                    cbdata.arg[0] = (Datum)NULL;
-#else
 		    cbdata->args[0].isnull = TRUE;
 		    cbdata->args[0].value = (Datum)NULL;
-#endif
 		}
                 else {
-#if POSTGIS_PGSQL_VERSION < 120
-			cbdata.argnull[0] = FALSE;
-			cbdata.arg[0] = Float8GetDatum(r);
-#else
 			cbdata->args[0].isnull = FALSE;
 			cbdata->args[0].value = Float8GetDatum(r);
-#endif
 		}
 
                 /* Add pixel positions if callback has proper # of args */
@@ -5519,32 +5448,19 @@ Datum RASTER_mapAlgebraFct(PG_FUNCTION_ARGS)
 
                     a = construct_array(d, 2, INT4OID, sizeof(int32), true, 'i');
 
-#if POSTGIS_PGSQL_VERSION < 120
-		    cbdata.argnull[1] = FALSE;
-                    cbdata.arg[1] = PointerGetDatum(a);
-#else
 		    cbdata->args[1].isnull = FALSE;
 		    cbdata->args[1].value = PointerGetDatum(a);
-#endif
 		}
 
                 POSTGIS_RT_DEBUGF(3, "RASTER_mapAlgebraFct: (%dx%d), r = %f",
                     x, y, r);
 
-#if POSTGIS_PGSQL_VERSION < 120
-		tmpnewval = FunctionCallInvoke(&cbdata);
-
-                if (cbdata.isnull) {
-                    newval = newnodatavalue;
-                }
-#else
 		tmpnewval = FunctionCallInvoke(cbdata);
 
 		if (cbdata->isnull)
 		{
 			newval = newnodatavalue;
 		}
-#endif
 		else {
                     newval = DatumGetFloat8(tmpnewval);
                 }
@@ -5600,11 +5516,7 @@ Datum RASTER_mapAlgebraFctNgb(PG_FUNCTION_ARGS)
     int ret = -1;
     Oid oid;
     FmgrInfo cbinfo;
-#if POSTGIS_PGSQL_VERSION < 120
-    FunctionCallInfoData cbdata;
-#else
     LOCAL_FCINFO(cbdata, FUNC_MAX_ARGS); /* Could be optimized */
-#endif
     Datum tmpnewval;
     ArrayType * neighborDatum;
     char * strFromText = NULL;
@@ -5851,15 +5763,10 @@ Datum RASTER_mapAlgebraFctNgb(PG_FUNCTION_ARGS)
     }
 
     /* prep function call data */
-#if POSTGIS_PGSQL_VERSION < 120
-    InitFunctionCallInfoData(cbdata, &cbinfo, 3, InvalidOid, NULL, NULL);
-    memset(cbdata.argnull, FALSE, sizeof(bool) * 3);
-#else
     InitFunctionCallInfoData(*cbdata, &cbinfo, 3, InvalidOid, NULL, NULL);
     cbdata->args[0].isnull = FALSE;
     cbdata->args[1].isnull = FALSE;
     cbdata->args[2].isnull = FALSE;
-#endif
 
     /* check that the function isn't strict if the args are null. */
     if (PG_ARGISNULL(7)) {
@@ -5873,20 +5780,11 @@ Datum RASTER_mapAlgebraFctNgb(PG_FUNCTION_ARGS)
             PG_RETURN_NULL();
         }
 
-#if POSTGIS_PGSQL_VERSION < 120
-	cbdata.arg[2] = (Datum)NULL;
-        cbdata.argnull[2] = TRUE;
-#else
 	cbdata->args[2].value = (Datum)NULL;
 	cbdata->args[2].isnull = TRUE;
-#endif
     }
     else {
-#if POSTGIS_PGSQL_VERSION < 120
-	    cbdata.arg[2] = PG_GETARG_DATUM(7);
-#else
 	    cbdata->args[2].value = PG_GETARG_DATUM(7);
-#endif
     }
 
     /**
@@ -6006,11 +5904,7 @@ Datum RASTER_mapAlgebraFctNgb(PG_FUNCTION_ARGS)
     memcpy((void *)VARDATA(txtCallbackParam), (void *)VARDATA(txtNodataMode), VARSIZE(txtNodataMode) - VARHDRSZ);
 
     /* pass the nodata mode into the user function */
-#if POSTGIS_PGSQL_VERSION < 120
-    cbdata.arg[1] = CStringGetDatum(txtCallbackParam);
-#else
     cbdata->args[1].value = CStringGetDatum(txtCallbackParam);
-#endif
 
     strFromText = text_to_cstring(txtNodataMode);
     strFromText = rtpg_strtoupper(strFromText);
@@ -6129,18 +6023,6 @@ Datum RASTER_mapAlgebraFctNgb(PG_FUNCTION_ARGS)
                 neighborDatum = construct_md_array((void *)neighborData, neighborNulls, 2, neighborDims, neighborLbs,
                     FLOAT8OID, typlen, typbyval, typalign);
 
-#if POSTGIS_PGSQL_VERSION < 120
-		/* Assign the neighbor matrix as the first argument to the user function */
-                cbdata.arg[0] = PointerGetDatum(neighborDatum);
-
-                /* Invoke the user function */
-                tmpnewval = FunctionCallInvoke(&cbdata);
-
-                /* Get the return value of the user function */
-                if (cbdata.isnull) {
-                    newval = newnodatavalue;
-                }
-#else
 		/* Assign the neighbor matrix as the first argument to the user function */
 		cbdata->args[0].value = PointerGetDatum(neighborDatum);
 
@@ -6152,7 +6034,6 @@ Datum RASTER_mapAlgebraFctNgb(PG_FUNCTION_ARGS)
 		{
 			newval = newnodatavalue;
 		}
-#endif
 		else {
                     newval = DatumGetFloat8(tmpnewval);
                 }
@@ -6261,11 +6142,8 @@ Datum RASTER_mapAlgebra2(PG_FUNCTION_ARGS)
 
 	Oid ufc_noid = InvalidOid;
 	FmgrInfo ufl_info;
-#if POSTGIS_PGSQL_VERSION < 120
-	FunctionCallInfoData ufc_info;
-#else
 	LOCAL_FCINFO(ufc_info, FUNC_MAX_ARGS); /* Could be optimized */
-#endif
+
 	int ufc_nullcount = 0;
 
 	int idx = 0;
@@ -6992,10 +6870,6 @@ Datum RASTER_mapAlgebra2(PG_FUNCTION_ARGS)
 				}
 
 				/* prep function call data */
-#if POSTGIS_PGSQL_VERSION < 120
-				InitFunctionCallInfoData(ufc_info, &ufl_info, ufl_info.fn_nargs, InvalidOid, NULL, NULL);
-				memset(ufc_info.argnull, FALSE, sizeof(bool) * ufl_info.fn_nargs);
-#else
 				InitFunctionCallInfoData(
 				    *ufc_info, &ufl_info, ufl_info.fn_nargs, InvalidOid, NULL, NULL);
 				ufc_info->args[0].isnull = FALSE;
@@ -7003,22 +6877,11 @@ Datum RASTER_mapAlgebra2(PG_FUNCTION_ARGS)
 				ufc_info->args[2].isnull = FALSE;
 				if (ufl_info.fn_nargs == 4)
 					ufc_info->args[3].isnull = FALSE;
-#endif
 
 				if (ufl_info.fn_nargs != 4)
 					k = 2;
 				else
 					k = 3;
-#if POSTGIS_PGSQL_VERSION < 120
-				if (!PG_ARGISNULL(7)) {
-					ufc_info.arg[k] = PG_GETARG_DATUM(7);
-				}
-				else {
-				 ufc_info.arg[k] = (Datum) NULL;
-				 ufc_info.argnull[k] = TRUE;
-				 ufc_nullcount++;
-				}
-#else
 				if (!PG_ARGISNULL(7))
 				{
 					ufc_info->args[k].value = PG_GETARG_DATUM(7);
@@ -7029,7 +6892,6 @@ Datum RASTER_mapAlgebra2(PG_FUNCTION_ARGS)
 					ufc_info->args[k].isnull = TRUE;
 					ufc_nullcount++;
 				}
-#endif
 			}
 			break;
 		}
@@ -7256,26 +7118,13 @@ Datum RASTER_mapAlgebra2(PG_FUNCTION_ARGS)
 
 						/* build fcnarg */
 						for (i = 0; i < set_count; i++) {
-#if POSTGIS_PGSQL_VERSION < 120
-							ufc_info.arg[i] = Float8GetDatum(_pixel[i]);
-#else
 							ufc_info->args[i].value = Float8GetDatum(_pixel[i]);
-#endif
-
 							if (_haspixel[i]) {
-#if POSTGIS_PGSQL_VERSION < 120
-								ufc_info.argnull[i] = FALSE;
-#else
 								ufc_info->args[i].isnull = FALSE;
-#endif
 								ufc_nullcount--;
 							}
 							else {
-#if POSTGIS_PGSQL_VERSION < 120
-								ufc_info.argnull[i] = TRUE;
-#else
 								ufc_info->args[i].isnull = TRUE;
-#endif
 								ufc_nullcount++;
 							}
 						}
@@ -7301,24 +7150,10 @@ Datum RASTER_mapAlgebra2(PG_FUNCTION_ARGS)
 							}
 
 							a = construct_array(d, 4, INT4OID, sizeof(int32), true, 'i');
-#if POSTGIS_PGSQL_VERSION < 120
-							ufc_info.arg[2] = PointerGetDatum(a);
-							ufc_info.argnull[2] = FALSE;
-#else
 							ufc_info->args[2].value = PointerGetDatum(a);
 							ufc_info->args[2].isnull = FALSE;
-#endif
 						}
 
-#if POSTGIS_PGSQL_VERSION < 120
-						datum = FunctionCallInvoke(&ufc_info);
-
-						/* result is not null*/
-						if (!ufc_info.isnull) {
-							haspixel = 1;
-							pixel = DatumGetFloat8(datum);
-						}
-#else
 						datum = FunctionCallInvoke(ufc_info);
 
 						/* result is not null*/
@@ -7327,7 +7162,6 @@ Datum RASTER_mapAlgebra2(PG_FUNCTION_ARGS)
 							haspixel = 1;
 							pixel = DatumGetFloat8(datum);
 						}
-#endif
 					}	break;
 				}
 
diff --git a/regress/core/tests.mk.in b/regress/core/tests.mk.in
index 70366505a..1ceae8573 100644
--- a/regress/core/tests.mk.in
+++ b/regress/core/tests.mk.in
@@ -136,18 +136,14 @@ TESTS += \
 	$(top_srcdir)/regress/core/oriented_envelope \
 	$(top_srcdir)/regress/core/point_coordinates \
 	$(top_srcdir)/regress/core/out_geojson \
-  $(top_srcdir)/regress/core/wrapx
+  $(top_srcdir)/regress/core/wrapx \
+	$(top_srcdir)/regress/core/computed_columns
 
 # Slow slow tests
 TESTS_SLOW = \
 	$(top_srcdir)/regress/core/concave_hull_hard \
 	$(top_srcdir)/regress/core/knn_recheck
 
-ifeq ($(shell expr "$(POSTGIS_PGSQL_VERSION)" ">=" 120),1)
-	TESTS += \
-		$(top_srcdir)/regress/core/computed_columns
-endif
-
 ifeq ($(shell expr "$(POSTGIS_GEOS_VERSION)" ">=" 30700),1)
 	# GEOS-3.7 adds:
 	# ST_FrechetDistance
diff --git a/topology/sql/manage/ValidateTopology.sql.in b/topology/sql/manage/ValidateTopology.sql.in
index a59a145f6..ac08bd287 100644
--- a/topology/sql/manage/ValidateTopology.sql.in
+++ b/topology/sql/manage/ValidateTopology.sql.in
@@ -74,11 +74,7 @@ BEGIN
         FROM %1$I.edge
         WHERE left_face = $1 or right_face = $1
         ORDER BY
-#if POSTGIS_PGSQL_VERSION < 95
-          ST_Distance(geom, $2)
-#else
           geom <-> $2
-#endif
         LIMIT 1
       ),
       edgering AS (

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

Summary of changes:
 .github/workflows/ci.yml                    |   4 +-
 NEWS                                        |   3 +
 configure.ac                                |  12 +-
 doc/postgis.xml                             |   4 +-
 liblwgeom/liblwgeom.h.in                    |  36 +-----
 liblwgeom/lwgeom_transform.c                | 108 -----------------
 libpgcommon/lwgeom_pg.c                     |  40 -------
 libpgcommon/lwgeom_pg.h                     |   4 -
 libpgcommon/lwgeom_transform.c              |  78 +-----------
 postgis/geography.sql.in                    |  33 ------
 postgis/gserialized_estimate.c              |  24 ----
 postgis/gserialized_supportfn.c             |   4 -
 postgis/lwgeom_accum.c                      |  40 -------
 postgis/lwgeom_in_gml.c                     |  43 -------
 postgis/lwgeom_transform.c                  |   6 +-
 postgis/postgis.sql.in                      | 101 ----------------
 raster/rt_pg/rtpg_mapalgebra.c              | 176 +---------------------------
 regress/core/tests.mk.in                    |   8 +-
 topology/sql/manage/ValidateTopology.sql.in |   4 -
 19 files changed, 24 insertions(+), 704 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list