[postgis-tickets] r15635 - Revert "Rework PGSQL_VERSION again so to use 2-digits minor from 10 onward"

Sandro Santilli strk at kbt.io
Tue Sep 5 14:25:01 PDT 2017


Author: strk
Date: 2017-09-05 14:25:01 -0700 (Tue, 05 Sep 2017)
New Revision: 15635

Modified:
   branches/2.3/configure.ac
   branches/2.3/libpgcommon/gserialized_gist.c
   branches/2.3/postgis/gserialized_estimate.c
   branches/2.3/postgis/gserialized_gist_nd.c
Log:
Revert "Rework PGSQL_VERSION again so to use 2-digits minor from 10 onward"

This reverts commit r15631

For information about PostgreSQL versioning changes, see
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=69dc5ae408f68c302029a6b43912a2cc16b1256c

Ref #3614

Modified: branches/2.3/configure.ac
===================================================================
--- branches/2.3/configure.ac	2017-09-05 21:23:18 UTC (rev 15634)
+++ branches/2.3/configure.ac	2017-09-05 21:25:01 UTC (rev 15635)
@@ -430,22 +430,18 @@
   dnl Note: we extract the major & minor separately, ensure they are numeric, and then combine to give
   dnl the final version. This is to guard against user error...
   PGSQL_FULL_VERSION=`$PG_CONFIG --version`
-
   PGSQL_MAJOR_VERSION=`echo $PGSQL_FULL_VERSION | sed 's/[[^0-9]]*\([[0-9]]*\).*/\1/'`
   PGSQL_MINOR_VERSION=`echo $PGSQL_FULL_VERSION | sed 's/[[^\.]]*\.\([[0-9]]*\).*/\1/'`
-  if test "$PGSQL_MINOR_VERSION" = "$PGSQL_FULL_VERSION"; then
-      dnl No match means there's no minor version
-      PGSQL_MINOR_VERSION="0"
-  fi
-
+  PGSQL_MINOR_VERSION=`echo $PGSQL_MINOR_VERSION | sed 's/.*devel.*/0/'`
+  
   if test $PGSQL_MAJOR_VERSION -gt 9; then
-       dnl ==================================================================
-       dnl Starting with PostgreSQL 10, we use 2 digits for minor version
-       dnl This is to prevent things like 10.31 ranking higher than 11.0
-       dnl===================================================================
-       PGSQL_MINOR_VERSION=`printf %.2d $PGSQL_MINOR_VERSION`
+  	dnl ==================================================================
+  	dnl Starting with PostgreSQL 10, major is the new minor
+  	dnl This is to prevent things like 10.31 ranking higher than 11.0
+  	dnl===================================================================
+  	PGSQL_MINOR_VERSION=0
   fi
-
+  
   POSTGIS_PGSQL_VERSION="$PGSQL_MAJOR_VERSION$PGSQL_MINOR_VERSION"
 
   PGSQL_PKGLIBDIR=`$PG_CONFIG --pkglibdir`

Modified: branches/2.3/libpgcommon/gserialized_gist.c
===================================================================
--- branches/2.3/libpgcommon/gserialized_gist.c	2017-09-05 21:23:18 UTC (rev 15634)
+++ branches/2.3/libpgcommon/gserialized_gist.c	2017-09-05 21:25:01 UTC (rev 15635)
@@ -22,7 +22,7 @@
 #include "lwgeom_pg.h"       /* For debugging macros. */
 #include "gserialized_gist.h"
 
-#if POSTGIS_PGSQL_VERSION >= 1000
+#if POSTGIS_PGSQL_VERSION >= 100
 #include <float.h>
 #endif
 

Modified: branches/2.3/postgis/gserialized_estimate.c
===================================================================
--- branches/2.3/postgis/gserialized_estimate.c	2017-09-05 21:23:18 UTC (rev 15634)
+++ branches/2.3/postgis/gserialized_estimate.c	2017-09-05 21:25:01 UTC (rev 15635)
@@ -836,7 +836,7 @@
 
     /* Then read the geom status histogram from that */
   
-#if POSTGIS_PGSQL_VERSION < 1000
+#if POSTGIS_PGSQL_VERSION < 100
 	float4 *floatptr;
 	int nvalues;
 	

Modified: branches/2.3/postgis/gserialized_gist_nd.c
===================================================================
--- branches/2.3/postgis/gserialized_gist_nd.c	2017-09-05 21:23:18 UTC (rev 15634)
+++ branches/2.3/postgis/gserialized_gist_nd.c	2017-09-05 21:25:01 UTC (rev 15635)
@@ -52,7 +52,7 @@
 
 #include <assert.h>
 
-#if POSTGIS_PGSQL_VERSION >= 1000
+#if POSTGIS_PGSQL_VERSION >= 100
 #include <float.h>
 #endif
 



More information about the postgis-tickets mailing list