[postgis] 01/04: Imported Upstream version 2.3.1+dfsg

Bas Couwenberg sebastic at debian.org
Mon Nov 28 23:57:21 UTC 2016


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository postgis.

commit 0844205f0b5373efa1c6e6276e5cd521fbccea78
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Tue Nov 29 00:27:25 2016 +0100

    Imported Upstream version 2.3.1+dfsg
---
 .drone.yml                                         |   8 +-
 ChangeLog                                          | 164 +++++
 NEWS                                               |  25 +-
 README.md                                          |  20 +-
 README.postgis                                     |   6 +-
 Version.config                                     |   2 +-
 configure                                          |  62 ++
 configure.ac                                       |  24 +
 doc/doxygen.cfg.in                                 |   2 +-
 doc/extras_topology.xml                            |  32 +-
 doc/reference_measure.xml                          |   7 +-
 doc/reference_raster.xml                           |   2 +-
 doc/release_notes.xml                              | 817 +++++++++++----------
 doc/topology_comments.sql                          |   4 +-
 doc/using_postgis_dataman.xml                      |  19 +-
 extensions/address_standardizer/Makefile           |  16 +-
 .../address_standardizer.control                   |   2 +-
 .../address_standardizer_data_us.control           |   2 +-
 extensions/postgis/Makefile                        |   4 +-
 extensions/postgis/postgis.control                 |   2 +-
 extensions/postgis_sfcgal/Makefile                 |   4 +-
 extensions/postgis_sfcgal/postgis_sfcgal.control   |   2 +-
 extensions/postgis_tiger_geocoder/Makefile         |   4 +-
 .../postgis_tiger_geocoder.control                 |   2 +-
 extensions/postgis_topology/Makefile               |   4 +-
 .../postgis_topology/postgis_topology.control      |   2 +-
 extensions/upgradeable_versions.mk                 |   3 +-
 liblwgeom/lwgeodetic.c                             |   2 +
 liblwgeom/lwgeom_geos.c                            |   2 +-
 liblwgeom/lwstroke.c                               |   2 +
 libpgcommon/gserialized_gist.c                     |   7 +-
 libpgcommon/gserialized_gist.h                     |  13 +
 postgis/brin_2d.c                                  |  11 +-
 postgis/brin_nd.c                                  |  66 +-
 postgis/gserialized_gist_2d.c                      |   7 +-
 postgis/gserialized_gist_nd.c                      |   2 +-
 postgis/postgis.sql.in                             |  40 +-
 postgis/postgis_module.c                           |   7 +-
 postgis/sqldefines.h                               |  12 +-
 postgis_svn_revision.h                             |   2 +-
 raster/rt_pg/rtpostgis.c                           |  46 +-
 raster/rt_pg/rtpostgis.sql.in                      |  42 +-
 regress/geography.sql                              |   4 +
 regress/geography_expected                         |   1 +
 regress/regress_brin_index.sql                     |  77 +-
 regress/regress_brin_index_3d.sql                  | 134 +++-
 regress/regress_brin_index_3d_expected             |  41 ++
 regress/regress_brin_index_expected                |  21 +
 utils/check_all_upgrades.sh                        |  24 +
 49 files changed, 1265 insertions(+), 539 deletions(-)

diff --git a/.drone.yml b/.drone.yml
index cb788af..b3b7b5b 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -1,11 +1,15 @@
 # See http://readme.drone.io/0.5/usage/overview
 
+env:
+  global:
+    - RUNTESTFLAGS=-v
+
 # See https://git.osgeo.org/gogs/postgis/postgis-docker
 test-image: &test-image docker.kbt.io/postgis/build-test:trisquel
 
 pipeline:
   clone:
-    image: git
+    image: plugins/git
     depth: 20
     recursive: false
   build:
@@ -19,3 +23,5 @@ pipeline:
     commands:
       - service postgresql start
       - make check
+      - make install
+      - utils/check_all_upgrades.sh 2.4.0dev
diff --git a/ChangeLog b/ChangeLog
index f294bf8..6b4111d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,167 @@
+2016-11-26 21:49  Regina Obe <lr at pcorp.us>
+
+	* [r15260] HOWTO_RELEASE: Add build badges, trunk vs. branch
+	  release
+	  closes #3671 for PostGIS 2.3
+
+2016-11-26 19:54  Regina Obe <lr at pcorp.us>
+
+	* [r15256] NEWS, postgis/postgis.sql.in: Mark ST_Extent, ST_Mem*
+	  aggregate functions parallel safe
+	  closes #3650 for PostGIS 2.3.1
+
+2016-11-26 16:39  Regina Obe <lr at pcorp.us>
+
+	* [r15253] doc/reference_raster.xml: ST_DumpAsPolygons
+	  documentation confusing wrt no data value
+	  closes #3512 for PostGIS 2.3.1
+
+2016-11-26 15:19  Regina Obe <lr at pcorp.us>
+
+	* [r15250] doc/reference_measure.xml: ST_Equals documentation does
+	  not describe current behavior
+	  closes #3566 for 2.3.1
+
+2016-11-26 14:55  Regina Obe <lr at pcorp.us>
+
+	* [r15246] doc/extras_topology.xml: Incorrect parameter name for
+	  CreateTopology
+	  references #3509 for 2.3.1
+
+2016-11-25 01:05  Regina Obe <lr at pcorp.us>
+
+	* [r15245] NEWS, raster/rt_pg/rtpostgis.sql.in: add raster
+	  constraint max extent exceeds array size limit
+	  references #3501 for 2.3 (PostGIS 2.3.1)
+
+2016-11-21 15:03  Paul Ramsey <pramsey at cleverelephant.ca>
+
+	* [r15238] configure.ac: Change MSG line
+
+2016-11-17 08:01  Sandro Santilli <strk at kbt.io>
+
+	* [r15235] doc/extras_topology.xml: Backport trunk changes in
+	  topology docs
+
+2016-11-15 23:32  Paul Ramsey <pramsey at cleverelephant.ca>
+
+	* [r15231] configure.ac: OS guard 10.12 osx libxml fix
+
+2016-11-11 19:51  Regina Obe <lr at pcorp.us>
+
+	* [r15228] NEWS: add missing bug fix to list
+
+2016-11-11 19:42  Regina Obe <lr at pcorp.us>
+
+	* [r15227] NEWS, doc/using_postgis_dataman.xml,
+	  libpgcommon/gserialized_gist.c, libpgcommon/gserialized_gist.h,
+	  postgis/brin_2d.c, postgis/brin_nd.c,
+	  postgis/gserialized_gist_2d.c, postgis/gserialized_gist_nd.c,
+	  regress/regress_brin_index.sql,
+	  regress/regress_brin_index_3d.sql,
+	  regress/regress_brin_index_3d_expected,
+	  regress/regress_brin_index_expected: index corruption and memory
+	  leak in BRIN support
+	  Patch from Julien Rouhaud (Dalibo)
+	  closes #3665 for PostGIS 2.3.1
+
+2016-11-10 00:11  Regina Obe <lr at pcorp.us>
+
+	* [r15222] NEWS, liblwgeom/lwgeodetic.c, regress/geography.sql,
+	  regress/geography_expected: Bug in geography ST_Segmentize
+	  References #3667 for PostGIS 2.3.1
+	  Patch provided by Hugo Mercier (Oslandia)
+
+2016-10-30 22:30  Regina Obe <lr at pcorp.us>
+
+	* [r15220] NEWS, postgis/postgis.sql.in: st_concavehull() returns
+	  sometimes empty geometry collection
+	  references #1973 for PostGIS 2.3
+
+2016-10-28 15:41  Sandro Santilli <strk at kbt.io>
+
+	* [r15216] .drone.yml: Update drone yml to 0.5 version
+	  
+	  See https://git.osgeo.org/gogs/sac/gogs-service/issues/14
+
+2016-10-16 01:16  Regina Obe <lr at pcorp.us>
+
+	* [r15209] raster/rt_pg/rtpostgis.c: raster GUC -
+	  boot_postgis_gdal_enabled_drivers should use TopMemoryContext
+	  instead of CurrentMemoryContext
+	  References #3659 for 2.3 (PostGIS 2.3.4) patch provided by
+	  manaeem
+
+2016-10-10 20:24  Sandro Santilli <strk at kbt.io>
+
+	* [r15202] liblwgeom/lwgeom_geos.c: Fix typo in error message about
+	  ClipByBox availability
+
+2016-10-10 19:46  Sandro Santilli <strk at kbt.io>
+
+	* [r15198] .drone.yml: Be verbose in running tests
+
+2016-10-08 09:11  Sandro Santilli <strk at kbt.io>
+
+	* [r15194] README.md: Fix buildbot badges to point to 2.3 branch
+	  
+	  See #3657
+
+2016-10-07 20:17  Sandro Santilli <strk at kbt.io>
+
+	* [r15191] utils/check_all_upgrades.sh: Add missing upgrade checker
+
+2016-10-07 20:05  Sandro Santilli <strk at kbt.io>
+
+	* [r15190] .drone.yml, NEWS, postgis/postgis.sql.in: Fix aggregates
+	  upgrade
+	  
+	  Fixes #3656 (aggregate upgrades)
+	  
+	  Enables automated ugprade testing
+
+2016-10-06 17:31  Sandro Santilli <strk at kbt.io>
+
+	* [r15179] doc/doxygen.cfg.in: Remove hard-coded version in Doxygen
+	  project name
+
+2016-10-03 20:21  Paul Ramsey <pramsey at cleverelephant.ca>
+
+	* [r15168] NEWS, liblwgeom/lwstroke.c: #3652, Crash on
+	  collection(multicurve())
+
+2016-09-27 22:55  Regina Obe <lr at pcorp.us>
+
+	* [r15160] README.postgis:
+
+2016-09-27 08:12  Sandro Santilli <strk at kbt.io>
+
+	* [r15157] NEWS, postgis/postgis_module.c: Do not call printf from
+	  interrupt handler, fixing deadlocks
+	  
+	  Closes #3644 for 2.3 branch
+
+2016-09-26 21:47  Regina Obe <lr at pcorp.us>
+
+	* [r15153] NEWS, configure.ac: PostGIS not building on latest OSX
+	  XCode
+	  References #3643 for PostGIS 2.3.1 (patch from pramsey)
+
+2016-09-26 05:45  Regina Obe <lr at pcorp.us>
+
+	* [r15148] Version.config, extensions/upgradeable_versions.mk: bump
+	  up version to 2.3.1dev
+
+2016-09-26 05:15  Regina Obe <lr at pcorp.us>
+
+	* [r15145] doc/release_notes.xml: fix typo in release notes
+
+2016-09-26 04:45  Regina Obe <lr at pcorp.us>
+
+	* [r15144] ChangeLog, NEWS, README.postgis, Version.config,
+	  doc/release_notes.xml, extensions/upgradeable_versions.mk: Get
+	  ready for PostGIS 2.3.0 launch
+
 2016-09-26 03:26  Regina Obe <lr at pcorp.us>
 
 	* [r15143] .: Branch 2.3 (trunk will become 2.4 after we are done)
diff --git a/NEWS b/NEWS
index 0535be6..cb5b969 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,24 @@
+PostGIS 2.3.1
+2016/11/28
+
+  * Bug Fixes
+  - #1973, st_concavehull() returns sometimes empty geometry collection
+           Fix from gde
+  - #3501, add raster constraint max extent exceeds array size limit
+        for large tables
+  - #3643, PostGIS not building on latest OSX XCode
+  - #3644, Deadlock on interrupt
+  - #3650, Mark ST_Extent, ST_3DExtent and ST_Mem* 
+        agg functions as parallel safe so they can be parallelized
+  - #3652, Crash on Collection(MultiCurve())
+  - #3656, Fix upgrade of aggregates from 2.2 or lower version
+  - #3659, Crash caused by raster GUC define after CREATE EXTENSION
+     using wrong memory context. (manaeem)
+  - #3665, Index corruption and memory leak in BRIN indexes
+    patch from Julien Rouhaud (Dalibo)
+  - #3667, geography ST_Segmentize bug
+    patch from Hugo Mercier (Oslandia)
+
 PostGIS 2.3.0
 2016/09/26
 
@@ -8,7 +29,7 @@ PostGIS 2.3.0
 
   - #3604, pgcommon/Makefile.in orders CFLAGS incorrectly leading to
            wrong liblwgeom.h (Greg Troxel)
-   
+
   - #3396, ST_EstimatedExtent, throw WARNING instead of ERROR
            (Regina Obe)
 
@@ -27,7 +48,7 @@ PostGIS 2.3.0
   - #1758, ST_Normalize (Sandro Santilli)
   - #2236, shp2pgsql -d now emits "DROP TABLE IF EXISTS"
   - #2259, ST_VoronoiPolygons and ST_VoronoiLines (Dan Baston)
-  - #2841 and #2996, ST_MinimumBoundingRadius and new ST_MinimumBoundingCircle 
+  - #2841 and #2996, ST_MinimumBoundingRadius and new ST_MinimumBoundingCircle
            implementation using Welzl's algorithm (Dan Baston)
   - #2991, Enable ST_Transform to use PROJ.4 text (Mike Toews)
   - #3059, Allow passing per-dimension parameters in ST_Expand (Dan Baston)
diff --git a/README.md b/README.md
index e04a7a2..9b5249d 100644
--- a/README.md
+++ b/README.md
@@ -1,18 +1,18 @@
 Debbie:
- [![Build Status](https://debbie.postgis.net/buildStatus/icon?job=PostGIS_trunk)]
- (https://debbie.postgis.net/view/PostGIS/job/PostGIS_trunk/)
+ [![Build Status](https://debbie.postgis.net/buildStatus/icon?job=PostGIS_2.3)]
+ (https://debbie.postgis.net/view/PostGIS/job/PostGIS_2.3/)
 Winnie:
- [![Build Status](https://debbie.postgis.net:444/buildStatus/icon?job=PostGIS_trunk)]
- (https://debbie.postgis.net:444/view/PostGIS/job/PostGIS_trunk/)
+ [![Build Status](https://debbie.postgis.net:444/buildStatus/icon?job=PostGIS_2.3)]
+ (https://debbie.postgis.net:444/view/PostGIS/job/PostGIS_2.3/)
 Dronie:
- [![Build Status](https://drone.osgeo.kbt.io/api/badges/postgis/postgis/status.svg?branch=svn-trunk)]
- (https://drone.osgeo.kbt.io/postgis/postgis?branch=svn-trunk)
+ [![Build Status](https://drone.osgeo.kbt.io/api/badges/postgis/postgis/status.svg?branch=svn-2.3)]
+ (https://drone.osgeo.kbt.io/postgis/postgis?branch=svn-2.3)
 Travis:
- [![Build Status](https://secure.travis-ci.org/postgis/postgis.png)]
- (http://travis-ci.org/postgis/postgis)
+ [![Build Status](https://secure.travis-ci.org/postgis/postgis.png?branch=svn-2.3)]
+ (http://travis-ci.org/postgis/postgis?branch=svn-2.3)
 GitLab-CI:
- [![Gitlab-CI](https://gitlab.com/postgis/postgis/badges/svn-trunk/build.svg)]
- (https://gitlab.com/postgis/postgis/commits/svn-trunk)
+ [![Gitlab-CI](https://gitlab.com/postgis/postgis/badges/svn-2.3/build.svg)]
+ (https://gitlab.com/postgis/postgis/commits/svn-2.3)
 
 This file is here to play nicely with modern code repository facilities.
 Actual readme is [here](README.postgis).
diff --git a/README.postgis b/README.postgis
index e01e127..287782d 100644
--- a/README.postgis
+++ b/README.postgis
@@ -1,8 +1,8 @@
 PostGIS - Geographic Information Systems Extensions to PostgreSQL
 =================================================================
 
-:Version: 2.3.0
-:Date: 2016-09-26
+:Version: 2.3.1
+:Date: 2016-11-28
 :Website: http://postgis.net
 
 This distribution contains a module which implements GIS simple features, ties
@@ -31,7 +31,7 @@ Directory structure::
 REQUIREMENTS
 ------------
 
-PostGIS is compatible with PostgreSQL 9.1 and above.
+PostGIS is compatible with PostgreSQL 9.2 and above.
 
 You *must* have the full PostgreSQL - including server headers - installed for
 this to work.
diff --git a/Version.config b/Version.config
index fd394b5..5fc9922 100644
--- a/Version.config
+++ b/Version.config
@@ -5,7 +5,7 @@
 
 POSTGIS_MAJOR_VERSION=2
 POSTGIS_MINOR_VERSION=3
-POSTGIS_MICRO_VERSION=0
+POSTGIS_MICRO_VERSION=1
 
 # Liblwgeom interface versioning, reset to 0:0:0 (cur:age:rev)
 # when changing POSTGIS_MINOR_VERSION
diff --git a/configure b/configure
index a35ed99..266fb10 100755
--- a/configure
+++ b/configure
@@ -718,6 +718,7 @@ GEOS_CPPFLAGS
 GEOS_LDFLAGS
 GEOSCONFIG
 POSTGIS_LIBXML2_VERSION
+XCRUN
 XML2CONFIG
 HAVE_BRIN
 POSTGIS_PGSQL_VERSION
@@ -13637,6 +13638,67 @@ fi
 XML2_LDFLAGS=`$XML2CONFIG --libs`
 XML2_CPPFLAGS=`$XML2CONFIG --cflags`
 
+
+case $host_os in
+    darwin*)
+        # Extract the first word of "xcrun", so it can be a program name with args.
+set dummy xcrun; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_XCRUN+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $XCRUN in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_XCRUN="$XCRUN" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_XCRUN="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+XCRUN=$ac_cv_path_XCRUN
+if test -n "$XCRUN"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XCRUN" >&5
+$as_echo "$XCRUN" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+        if test "x$XCRUN" = "x"; then
+        	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: using OSX XCode... no" >&5
+$as_echo "using OSX XCode... no" >&6; }
+        else
+            XCODE_VER=`$XCRUN --show-sdk-version`
+            if test $XCODE_VER = "10.12"; then
+                { $as_echo "$as_me:${as_lineno-$LINENO}: result: applying OSX XCode 10.12 libxml special case... yes" >&5
+$as_echo "applying OSX XCode 10.12 libxml special case... yes" >&6; }
+                XML2_LDFLAGS=`$XML2CONFIG --exec-prefix=/usr --libs`
+            else
+                { $as_echo "$as_me:${as_lineno-$LINENO}: result: using OSX XCode $XCODE_VER... yes" >&5
+$as_echo "using OSX XCode $XCODE_VER... yes" >&6; }
+            fi
+        fi
+        ;;
+esac
+
+
 POSTGIS_LIBXML2_VERSION=`$XML2CONFIG --version`
 
 CPPFLAGS_SAVE="$CPPFLAGS"
diff --git a/configure.ac b/configure.ac
index 5c24699..df6dd88 100644
--- a/configure.ac
+++ b/configure.ac
@@ -564,6 +564,30 @@ dnl Extract the linker and include flags
 XML2_LDFLAGS=`$XML2CONFIG --libs`
 XML2_CPPFLAGS=`$XML2CONFIG --cflags`
 
+
+dnl
+dnl XCode in 10.12 supplies bad flags in xml2config resulting
+dnl in compile errors. For that one version, we force the prefix
+dnl to match where we know the libraries reside
+dnl
+case $host_os in
+    darwin*)
+        AC_PATH_PROG([XCRUN], [xcrun])
+        if test "x$XCRUN" = "x"; then
+        	AC_MSG_RESULT([using OSX XCode... no])
+        else
+            XCODE_VER=`$XCRUN --show-sdk-version`
+            if test $XCODE_VER = "10.12"; then
+                AC_MSG_RESULT([applying OSX XCode 10.12 libxml special case... yes])
+                XML2_LDFLAGS=`$XML2CONFIG --exec-prefix=/usr --libs`
+            else
+                AC_MSG_RESULT([using OSX XCode $XCODE_VER... yes])
+            fi
+        fi
+        ;;
+esac
+
+
 dnl Extract the version
 POSTGIS_LIBXML2_VERSION=`$XML2CONFIG --version`
 
diff --git a/doc/doxygen.cfg.in b/doc/doxygen.cfg.in
index d455dd6..0ee3f09 100644
--- a/doc/doxygen.cfg.in
+++ b/doc/doxygen.cfg.in
@@ -17,7 +17,7 @@
 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded
 # by quotes) that should identify the project.
 
-PROJECT_NAME           = "PostGIS Trunk Doxygen"
+PROJECT_NAME           = "PostGIS"
 
 # The PROJECT_NUMBER tag can be used to enter a project or revision number.
 # This could be handy for archiving the generated documentation or
diff --git a/doc/extras_topology.xml b/doc/extras_topology.xml
index cacaad0..52fc73f 100644
--- a/doc/extras_topology.xml
+++ b/doc/extras_topology.xml
@@ -2,7 +2,7 @@
 <chapter id="Topology">
 	<title>Topology</title>
 	<para>The PostGIS Topology types and functions are used to manage topological objects such as faces, edges and nodes. </para>
-	<para>Sandro Santilli's presentation at PostGIS Day Paris 2011  conference gives a good synopsis of PostGIS Topology and where it is headed <ulink url="http://strk.keybit.net/projects/postgis/Paris2011_TopologyWithPostGIS_2_0.pdf">Topology with PostGIS 2.0 slide deck</ulink>.</para>
+	<para>Sandro Santilli's presentation at PostGIS Day Paris 2011  conference gives a good synopsis of PostGIS Topology and where it is headed <ulink url="http://strk.kbt.io/projects/postgis/Paris2011_TopologyWithPostGIS_2_0.pdf">Topology with PostGIS 2.0 slide deck</ulink>.</para>
 	<para>Vincent Picavet provides a good synopsis and overview of what is Topology, how is it used, and various FOSS4G tools that support it in <ulink url="https://github.com/Oslandia/presentations/blob/master/pgconf_eu_2012/pgconfeu2012_vincent_picavet_postgis_topology.pdf?raw=true">PostGIS Topology PGConf EU 2012</ulink>.</para>
     <para>An example of a topologically based GIS database is the <ulink url="https://www.census.gov/geo/maps-data/data/tiger.html">US Census Topologically Integrated Geographic Encoding and Referencing System (TIGER)</ulink> database. If you want to experiment with PostGIS topology and need some data, check out <xref linkend="Topology_Load_Tiger" />.</para>
 	<para>The PostGIS topology module has existed in prior versions of PostGIS but was never part of the Official PostGIS documentation.
@@ -412,15 +412,15 @@ SELECT topology.AddTopoGeometryColumn('ri_topo', 'ri', 'roads', 'topo', 'LINE');
 				<para><xref linkend="AddTopoGeometryColumn"/></para>
 			</refsection>
 		</refentry>
-		
+
 		<refentry id="Populate_Topology_Layer">
 			<refnamediv>
 				<refname>Populate_Topology_Layer</refname>
 
 				<refpurpose>Adds missing entries to topology.layer table by reading metadata from topo tables.</refpurpose>
 			</refnamediv>
-			
-		
+
+
 			<refsynopsisdiv>
 				<funcsynopsis>
 					<funcprototype>
@@ -449,18 +449,18 @@ CREATE SCHEMA strk;
 CREATE TABLE strk.parcels(gid serial, parcel_id varchar(20) PRIMARY KEY, address text);
 SELECT topology.AddTopoGeometryColumn('strk_topo', 'strk', 'parcels', 'topo', 'POLYGON');
 -- this will return no records because this feature is already registered
-SELECT * 
-  FROM topology.Populate_Topology_Layer(); 
+SELECT *
+  FROM topology.Populate_Topology_Layer();
 
 -- let's rebuild
 TRUNCATE TABLE topology.layer;
 
-SELECT * 
-  FROM topology.Populate_Topology_Layer(); 
-  
+SELECT *
+  FROM topology.Populate_Topology_Layer();
+
 SELECT topology_id,layer_id, schema_name As sn, table_name As tn, feature_column As fc
 FROM topology.layer;
-				
+
 				</programlisting>
 				<screen> schema_name | table_name | feature_column
 -------------+------------+----------------
@@ -668,14 +668,14 @@ face without edges |   0 |
 						<funcdef>integer <function>CreateTopology</function></funcdef>
 						<paramdef><type>varchar </type> <parameter>topology_schema_name</parameter></paramdef>
 						<paramdef><type>integer </type> <parameter>srid</parameter></paramdef>
-						<paramdef><type>double precision </type> <parameter>tolerance</parameter></paramdef>
+						<paramdef><type>double precision </type> <parameter>prec</parameter></paramdef>
 					</funcprototype>
 
 					<funcprototype>
 						<funcdef>integer <function>CreateTopology</function></funcdef>
 						<paramdef><type>varchar </type> <parameter>topology_schema_name</parameter></paramdef>
 						<paramdef><type>integer </type> <parameter>srid</parameter></paramdef>
-						<paramdef><type>double precision </type> <parameter>tolerance</parameter></paramdef>
+						<paramdef><type>double precision </type> <parameter>prec</parameter></paramdef>
 						<paramdef><type>boolean </type> <parameter>hasz</parameter></paramdef>
 					</funcprototype>
 				</funcsynopsis>
@@ -686,7 +686,7 @@ face without edges |   0 |
 
                 <para>Creates a new schema with name <varname>topology_name</varname> consisting of tables (<varname>edge_data</varname>,<varname>face</varname>,<varname>node</varname>, <varname>relation</varname>
                     and registers this new topology in the topology.topology table. It returns the id of the topology in the topology table. The srid is the spatial reference identified as
-                defined in spatial_ref_sys table for that topology.  Topologies must be uniquely named.  The tolerance is measured in the units of the spatial reference system.  If the tolerance is not specified defaults to 0.</para>
+                defined in spatial_ref_sys table for that topology.  Topologies must be uniquely named.  The tolerance is measured in the units of the spatial reference system.  If the tolerance (<varname>prec</varname>) is not specified defaults to 0.</para>
 
                 <para>This is similar to the SQL/MM <xref linkend="ST_InitTopoGeo" /> but a bit more functional.  <varname>hasz</varname> defaults to false if not specified.</para>
 
@@ -2510,7 +2510,11 @@ edgeid
 			<!-- Optionally add a "See Also" section -->
 			<refsection>
 				<title>See Also</title>
-				<para><xref linkend="CreateTopology"/>, <xref linkend="spatial_ref_sys"/></para>
+				<para>
+<xref linkend="TopoGeo_AddLineString"/>,
+<xref linkend="CreateTopology"/>,
+<xref linkend="spatial_ref_sys"/>
+        </para>
 			</refsection>
 		</refentry>
 
diff --git a/doc/reference_measure.xml b/doc/reference_measure.xml
index 8b4d4de..5c57765 100644
--- a/doc/reference_measure.xml
+++ b/doc/reference_measure.xml
@@ -2983,15 +2983,12 @@ SELECT s.gid, s.school_name
 			points are the same).</para>
 
 		<important>
-		  <para>This function will return false if either geometry is invalid even if they are binary equal.</para>
+		  <para>This function will return false if either geometry is invalid except in the case where they are binary equal.</para>
 		</important>
 
-    <important>
-      <para>Do not call with a GEOMETRYCOLLECTION as an argument.</para>
-    </important>
-
 		<para>&sfs_compliant; s2.1.1.2</para>
 		<para>&sqlmm_compliant; SQL-MM 3: 5.1.24</para>
+        <para>Changed: 2.2.0 Returns true even for invalid geometries if they are binary equal</para>
 	  </refsection>
 
 	  <refsection>
diff --git a/doc/reference_raster.xml b/doc/reference_raster.xml
index dfd85ad..723461a 100644
--- a/doc/reference_raster.xml
+++ b/doc/reference_raster.xml
@@ -12811,7 +12811,7 @@ FROM (SELECT ST_SetRotation(rast, 0.1, 0.1) As rast
 					can be used to expand a single raster into multiple POLYGONS/MULTIPOLYGONS.</para>
 
 					<para>Availability: Requires GDAL 1.7 or higher.</para>
-					<note><para>If there is a no data value set for a band, pixels with that value will not be returned.</para></note>
+					<note><para>If there is a no data value set for a band, pixels with that value will not be returned except in the case of exclude_nodata_value=false.</para></note>
 					<note><para>If you only care about count of pixels with a given value in a raster, it is faster to use <xref linkend="RT_ST_ValueCount" />.</para></note>
 					<note>
 						<para>
diff --git a/doc/release_notes.xml b/doc/release_notes.xml
index caf0c04..abaedc6 100644
--- a/doc/release_notes.xml
+++ b/doc/release_notes.xml
@@ -2,87 +2,112 @@
 <appendix id="release_notes">
   <title>Appendix</title>
     <subtitle>Release Notes</subtitle>
-     <sect1>
+    <sect1>
+      <title>Release 2.3.1</title>
+      <para>Release date: 2016/11/28</para>
+      <para>This is a bug fix and performance improvement release.</para>
+      <simplesect>
+        <title>Bug Fixes and Enhancements</title>
+          <para>#1973, st_concavehull() returns sometimes empty geometry collection
+                   Fix from gde</para>
+          <para>#3501, add raster constraint max extent exceeds array size limit
+                for large tables</para>
+          <para>#3643, PostGIS not building on latest OSX XCode</para>
+          <para>#3644, Deadlock on interrupt</para>
+          <para>#3650, Mark ST_Extent, ST_3DExtent and ST_Mem* 
+                agg functions as parallel safe so they can be parallelized</para>
+          <para>#3652, Crash on Collection(MultiCurve())</para>
+          <para>#3656, Fix upgrade of aggregates from 2.2 or lower version</para>
+          <para>#3659, Crash caused by raster GUC define after CREATE EXTENSION
+             using wrong memory context. (manaeem)</para>
+          <para>#3665, Index corruption and memory leak in BRIN indexes
+            patch from Julien Rouhaud (Dalibo)</para>
+          <para>#3667, geography ST_Segmentize bug
+            patch from Hugo Mercier (Oslandia)</para>
+      </simplesect>
+    </sect1>
+      
+    <sect1>
       <title>Release 2.3.0</title>
-          <para>Release date: 2016/09/26</para>
-          <para>This is a new feature release, with new functions, improved performance, all relevant bug fixes from PostGIS 2.2.3,and other goodies.</para>
-          
-        <simplesect>
-          <title>Important / Breaking Changes</title>
-            <para>#3466, Casting from box3d to geometry now returns a 3D
-                     geometry (Julien Rouhaud of Dalibo)</para>     
-            <para>#3396, ST_EstimatedExtent, throw WARNING instead of ERROR
-                     (Regina Obe)</para>
-        </simplesect>
-     
-
-        <simplesect>
-            <title>New Features</title>
-              <para>Add support for custom TOC in postgis_restore.pl
-                (Christoph Moench-Tegeder)</para>
-              <para>Add support for negative indexing in ST_PointN and ST_SetPoint
-                (Rémi Cura)</para>
-              <para>Add parameters for geography ST_Buffer (Thomas Bonfort)</para>
-              <para>TopoGeom_addElement, TopoGeom_remElement (Sandro Santilli)</para>
-              <para>populate_topology_layer (Sandro Santilli)</para>
-              <para>#454,  ST_WrapX and lwgeom_wrapx (Sandro Santilli)</para>
-              <para>#1758, ST_Normalize (Sandro Santilli)</para>
-              <para>#2236, shp2pgsql -d now emits "DROP TABLE IF EXISTS"</para>
-              <para>#2259, ST_VoronoiPolygons and ST_VoronoiLines (Dan Baston)</para>
-              <para>#2841 and #2996, ST_MinimumBoundingRadius and new ST_MinimumBoundingCircle 
-                       implementation using Welzl's algorithm (Dan Baston)</para>
-              <para>#2991, Enable ST_Transform to use PROJ.4 text (Mike Toews)</para>
-              <para>#3059, Allow passing per-dimension parameters in ST_Expand (Dan Baston)</para>
-              <para>#3339, ST_GeneratePoints (Paul Ramsey)</para>
-              <para>#3362, ST_ClusterDBSCAN (Dan Baston)</para>
-              <para>#3364, ST_GeometricMedian (Dan Baston)</para>
-              <para>#3391, Add table inheritance support in ST_EstimatedExtent
-                       (Alessandro Pasotti)</para>
-              <para>#3424, ST_MinimumClearance (Dan Baston)</para>
-              <para>#3428, ST_Points (Dan Baston)</para>
-              <para>#3465, ST_ClusterKMeans (Paul Ramsey)</para>
-              <para>#3469, ST_MakeLine with MULTIPOINTs (Paul Norman)</para>
-              <para>#3549, Support PgSQL 9.6 parallel query mode, as far as possible
-                       (Paul Ramsey, Regina Obe)</para>
-              <para>#3557, Geometry function costs based on query stats (Paul Norman)</para>
-              <para>#3591, Add support for BRIN indexes. PostgreSQL 9.4+ required.
-                       (Giuseppe Broccolo of 2nd Quadrant, Julien Rouhaud
-                        and Ronan Dunklau of Dalibo)</para>
-              <para>#3496, Make postgis non-relocateable for extension install,
-                       schema qualify calls in functions (Regina Obe)
-                       Should resolve once and for all for extensions #3494, #3486, #3076</para>
-              <para>#3547, Update tiger geocoder to support TIGER 2016
-                       and to support both http and ftp.</para>
-              <para>#3613, Segmentize geography using equal length segments
-                       (Hugo Mercier of Oslandia)</para>
-        </simplesect>
+        <para>Release date: 2016/09/26</para>
+        <para>This is a new feature release, with new functions, improved performance, all relevant bug fixes from PostGIS 2.2.3,and other goodies.</para>
+        
+      <simplesect>
+        <title>Important / Breaking Changes</title>
+          <para>#3466, Casting from box3d to geometry now returns a 3D
+                   geometry (Julien Rouhaud of Dalibo)</para>     
+          <para>#3396, ST_EstimatedExtent, throw WARNING instead of ERROR
+                   (Regina Obe)</para>
+      </simplesect>
       
-        <simplesect>
-            <title>Bug Fixes</title>
-               <para>All relevant bug fixes from PostGIS 2.2.3</para>
-               <para>#2841, ST_MinimumBoundingCircle not covering original</para>
-               <para>#3604, pgcommon/Makefile.in orders CFLAGS incorrectly leading to
-                       wrong liblwgeom.h (Greg Troxel)</para>
-        </simplesect>
-
-        <simplesect>
-            <title>Performance Enhancements</title>
-              <para>#75, Enhancement to PIP short circuit (Dan Baston)</para>
-              <para>#3383, Avoid deserializing small geometries during index operations
-                       (Dan Baston)</para>
-              <para>#3400, Minor optimization of PIP routines (Dan Baston)</para>
-              <para>Make adding a line to topology interruptible (Sandro Santilli)</para>
-              <para>Documentation updates from Mike Toews</para>
+      
+      <simplesect>
+          <title>New Features</title>
+            <para>Add support for custom TOC in postgis_restore.pl
+              (Christoph Moench-Tegeder)</para>
+            <para>Add support for negative indexing in ST_PointN and ST_SetPoint
+              (Rémi Cura)</para>
+            <para>Add parameters for geography ST_Buffer (Thomas Bonfort)</para>
+            <para>TopoGeom_addElement, TopoGeom_remElement (Sandro Santilli)</para>
+            <para>populate_topology_layer (Sandro Santilli)</para>
+            <para>#454,  ST_WrapX and lwgeom_wrapx (Sandro Santilli)</para>
+            <para>#1758, ST_Normalize (Sandro Santilli)</para>
+            <para>#2236, shp2pgsql -d now emits "DROP TABLE IF EXISTS"</para>
+            <para>#2259, ST_VoronoiPolygons and ST_VoronoiLines (Dan Baston)</para>
+            <para>#2841 and #2996, ST_MinimumBoundingRadius and new ST_MinimumBoundingCircle 
+                     implementation using Welzl's algorithm (Dan Baston)</para>
+            <para>#2991, Enable ST_Transform to use PROJ.4 text (Mike Toews)</para>
+            <para>#3059, Allow passing per-dimension parameters in ST_Expand (Dan Baston)</para>
+            <para>#3339, ST_GeneratePoints (Paul Ramsey)</para>
+            <para>#3362, ST_ClusterDBSCAN (Dan Baston)</para>
+            <para>#3364, ST_GeometricMedian (Dan Baston)</para>
+            <para>#3391, Add table inheritance support in ST_EstimatedExtent
+                     (Alessandro Pasotti)</para>
+            <para>#3424, ST_MinimumClearance (Dan Baston)</para>
+            <para>#3428, ST_Points (Dan Baston)</para>
+            <para>#3465, ST_ClusterKMeans (Paul Ramsey)</para>
+            <para>#3469, ST_MakeLine with MULTIPOINTs (Paul Norman)</para>
+            <para>#3549, Support PgSQL 9.6 parallel query mode, as far as possible
+                     (Paul Ramsey, Regina Obe)</para>
+            <para>#3557, Geometry function costs based on query stats (Paul Norman)</para>
+            <para>#3591, Add support for BRIN indexes. PostgreSQL 9.4+ required.
+                     (Giuseppe Broccolo of 2nd Quadrant, Julien Rouhaud
+                      and Ronan Dunklau of Dalibo)</para>
+            <para>#3496, Make postgis non-relocateable for extension install,
+                     schema qualify calls in functions (Regina Obe)
+                     Should resolve once and for all for extensions #3494, #3486, #3076</para>
+            <para>#3547, Update tiger geocoder to support TIGER 2016
+                     and to support both http and ftp.</para>
+            <para>#3613, Segmentize geography using equal length segments
+                     (Hugo Mercier of Oslandia)</para>
       </simplesect>
-   
-   </sect1>
+      
+      <simplesect>
+          <title>Bug Fixes</title>
+             <para>All relevant bug fixes from PostGIS 2.2.3</para>
+             <para>#2841, ST_MinimumBoundingCircle not covering original</para>
+             <para>#3604, pgcommon/Makefile.in orders CFLAGS incorrectly leading to
+                     wrong liblwgeom.h (Greg Troxel)</para>
+      </simplesect>
+      
+      <simplesect>
+          <title>Performance Enhancements</title>
+            <para>#75, Enhancement to PIP short circuit (Dan Baston)</para>
+            <para>#3383, Avoid deserializing small geometries during index operations
+                     (Dan Baston)</para>
+            <para>#3400, Minor optimization of PIP routines (Dan Baston)</para>
+            <para>Make adding a line to topology interruptible (Sandro Santilli)</para>
+            <para>Documentation updates from Mike Toews</para>
+      </simplesect>
+    
+    </sect1>
    
    <sect1>
       <title>Release 2.2.2</title>
         <para>Release date: 2016/03/22</para>
         <para>This is a bug fix and performance improvement release.</para>
-  		  <simplesect>
-  			  <title>New Features</title>
+        <simplesect>
+          <title>New Features</title>
           <para>#3463, Fix crash on face-collapsing edge change</para>
           <para>#3422, Improve ST_Split robustness on standard precision double systems (arm64, ppc64el, s390c, powerpc, ...)</para>
           <para>#3427, Update spatial_ref_sys to EPSG version 8.8</para>
@@ -95,49 +120,49 @@
           <para>#3460, ST_ClusterWithin 'Tolerance not defined' error after upgrade</para>
           <para>#3490, Raster data restore issues, materialized views. Scripts postgis_proc_set_search_path.sql, rtpostgis_proc_set_search_path.sql refer to http://postgis.net/docs/manual-2.2/RT_FAQ.html#faq_raster_data_not_restore</para>
           <para>#3426, failing POINT EMPTY tests on fun architectures</para>
-  		  </simplesect>
+        </simplesect>
     </sect1>
     
      <sect1>
-	<title>Release 2.2.1</title>
-		  <para>Release date: 2016/01/06</para>
-		  <para>This is a bug fix and performance improvement release.</para>
-
-		  <simplesect>
-			<title>New Features</title>
-			  <para>#2232, avoid accumulated error in SVG rounding</para>
-			  <para>#3321, Fix performance regression in topology loading</para>
-			  <para>#3329, Fix robustness regression in TopoGeo_addPoint</para>
-			  <para>#3349, Fix installation path of postgis_topology scripts</para>
-			  <para>#3351, set endnodes isolation on ST_RemoveIsoEdge
-					   (and lwt_RemIsoEdge)</para>
-			  <para>#3355, geography ST_Segmentize has geometry bbox </para>
-			  <para>#3359, Fix toTopoGeom loss of low-id primitives from
-					   TopoGeometry definition</para>
-			  <para>#3360, _raster_constraint_info_scale invalid input syntax</para>
-			  <para>#3375, crash in repeated point removal for collection(point)</para>
-			  <para>#3378, Fix handling of hierarchical TopoGeometries
-					   in presence of multiple topologies</para>
-			  <para>#3380, #3402, Decimate lines on topology load</para>
-			  <para>#3388, #3410, Fix missing end-points in ST_Removepoints</para>
-			  <para>#3389, Buffer overflow in lwgeom_to_geojson</para>
-			  <para>#3390, Compilation under Alpine Linux 3.2
-						gives an error when compiling the postgis and postgis_topology extension</para>
-			  <para>#3393, ST_Area NaN for some polygons</para>
-			  <para>#3401, Improve ST_Split robustness on 32bit systems</para>
-			  <para>#3404, ST_ClusterWithin crashes backend</para>
-			  <para>#3407, Fix crash on splitting a face or an edge
-					   defining multiple TopoGeometry objects</para>
-			  <para>#3411, Clustering functions not using spatial index</para>
-			  <para>#3412, Improve robustness of snapping step in TopoGeo_addLinestring</para>
-			  <para>#3415, Fix OSX 10.9 build under pkgsrc</para>
-			  <para>Fix memory leak in lwt_ChangeEdgeGeom [liblwgeom]</para>
-		  </simplesect>
+  <title>Release 2.2.1</title>
+      <para>Release date: 2016/01/06</para>
+      <para>This is a bug fix and performance improvement release.</para>
+
+      <simplesect>
+      <title>New Features</title>
+        <para>#2232, avoid accumulated error in SVG rounding</para>
+        <para>#3321, Fix performance regression in topology loading</para>
+        <para>#3329, Fix robustness regression in TopoGeo_addPoint</para>
+        <para>#3349, Fix installation path of postgis_topology scripts</para>
+        <para>#3351, set endnodes isolation on ST_RemoveIsoEdge
+             (and lwt_RemIsoEdge)</para>
+        <para>#3355, geography ST_Segmentize has geometry bbox </para>
+        <para>#3359, Fix toTopoGeom loss of low-id primitives from
+             TopoGeometry definition</para>
+        <para>#3360, _raster_constraint_info_scale invalid input syntax</para>
+        <para>#3375, crash in repeated point removal for collection(point)</para>
+        <para>#3378, Fix handling of hierarchical TopoGeometries
+             in presence of multiple topologies</para>
+        <para>#3380, #3402, Decimate lines on topology load</para>
+        <para>#3388, #3410, Fix missing end-points in ST_Removepoints</para>
+        <para>#3389, Buffer overflow in lwgeom_to_geojson</para>
+        <para>#3390, Compilation under Alpine Linux 3.2
+            gives an error when compiling the postgis and postgis_topology extension</para>
+        <para>#3393, ST_Area NaN for some polygons</para>
+        <para>#3401, Improve ST_Split robustness on 32bit systems</para>
+        <para>#3404, ST_ClusterWithin crashes backend</para>
+        <para>#3407, Fix crash on splitting a face or an edge
+             defining multiple TopoGeometry objects</para>
+        <para>#3411, Clustering functions not using spatial index</para>
+        <para>#3412, Improve robustness of snapping step in TopoGeo_addLinestring</para>
+        <para>#3415, Fix OSX 10.9 build under pkgsrc</para>
+        <para>Fix memory leak in lwt_ChangeEdgeGeom [liblwgeom]</para>
+      </simplesect>
    </sect1>
 
     <sect1>
-	<title>Release 2.2.0</title>
-		<para>Release date: 2015/10/07</para>
+  <title>Release 2.2.0</title>
+    <para>Release date: 2015/10/07</para>
       <para>This is a new feature release, with new functions, improved performance, and other goodies.</para>
       <simplesect>
         <title>New Features</title>
@@ -211,7 +236,7 @@
         <para><ulink url="http://trac.osgeo.org/postgis/ticket/3048"><ulink url="http://trac.osgeo.org/postgis/ticket/3048">#3048</ulink></ulink>, Speed up geometry simplification (J.Santana @ CartoDB)</para>
         <para><ulink url="http://trac.osgeo.org/postgis/ticket/3092"><ulink url="http://trac.osgeo.org/postgis/ticket/3092">#3092</ulink></ulink>, Slow performance of geometry_columns with many tables</para>
     </simplesect>
-	</sect1>
+  </sect1>
 
     <sect1>
       <title>Release 2.1.8</title>
@@ -268,7 +293,7 @@
       </simplesect>
     </sect1>
 
-	<sect1>
+  <sect1>
         <title>Release 2.1.5</title>
         <para>Release date: 2014-12-18</para>
         <para>This is a bug fix and performance improvement release.</para>
@@ -279,17 +304,17 @@
         <simplesect>
               <title>Bug Fixes</title>
 
-						  <para><ulink url="http://trac.osgeo.org/postgis/ticket/2947"><ulink url="http://trac.osgeo.org/postgis/ticket/2947">#2947</ulink></ulink>, Fix memory leak in lwgeom_make_valid for single-component
-						           collection input</para>
-						  <para><ulink url="http://trac.osgeo.org/postgis/ticket/2949"><ulink url="http://trac.osgeo.org/postgis/ticket/2949">#2949</ulink></ulink>, Fix memory leak in lwgeom_mindistance2d for curve input</para>
-						  <para><ulink url="http://trac.osgeo.org/postgis/ticket/2931"><ulink url="http://trac.osgeo.org/postgis/ticket/2931">#2931</ulink></ulink>, BOX representation is case sensitive</para>
-						  <para><ulink url="http://trac.osgeo.org/postgis/ticket/2942"><ulink url="http://trac.osgeo.org/postgis/ticket/2942">#2942</ulink></ulink>, PostgreSQL 9.5 support</para>
-						  <para><ulink url="http://trac.osgeo.org/postgis/ticket/2953"><ulink url="http://trac.osgeo.org/postgis/ticket/2953">#2953</ulink></ulink>, 2D stats not generated when Z/M values are extreme</para>
-						  <para><ulink url="http://trac.osgeo.org/postgis/ticket/3009"><ulink url="http://trac.osgeo.org/postgis/ticket/3009">#3009</ulink></ulink>, Geography cast may effect underlying tuple</para>
+              <para><ulink url="http://trac.osgeo.org/postgis/ticket/2947"><ulink url="http://trac.osgeo.org/postgis/ticket/2947">#2947</ulink></ulink>, Fix memory leak in lwgeom_make_valid for single-component
+                       collection input</para>
+              <para><ulink url="http://trac.osgeo.org/postgis/ticket/2949"><ulink url="http://trac.osgeo.org/postgis/ticket/2949">#2949</ulink></ulink>, Fix memory leak in lwgeom_mindistance2d for curve input</para>
+              <para><ulink url="http://trac.osgeo.org/postgis/ticket/2931"><ulink url="http://trac.osgeo.org/postgis/ticket/2931">#2931</ulink></ulink>, BOX representation is case sensitive</para>
+              <para><ulink url="http://trac.osgeo.org/postgis/ticket/2942"><ulink url="http://trac.osgeo.org/postgis/ticket/2942">#2942</ulink></ulink>, PostgreSQL 9.5 support</para>
+              <para><ulink url="http://trac.osgeo.org/postgis/ticket/2953"><ulink url="http://trac.osgeo.org/postgis/ticket/2953">#2953</ulink></ulink>, 2D stats not generated when Z/M values are extreme</para>
+              <para><ulink url="http://trac.osgeo.org/postgis/ticket/3009"><ulink url="http://trac.osgeo.org/postgis/ticket/3009">#3009</ulink></ulink>, Geography cast may effect underlying tuple</para>
          </simplesect>
     </sect1>
 
-	<sect1>
+  <sect1>
         <title>Release 2.1.4</title>
         <para>Release date: 2014-09-10</para>
         <para>This is a bug fix and performance improvement release.</para>
@@ -337,39 +362,39 @@
          </simplesect>
     </sect1>
 
-	<sect1>
+  <sect1>
       <title>Release 2.1.3</title>
       <para>Release date: 2014/05/13</para>
       <para>This is a bug fix and security release.</para>
       <simplesect>
         <title>Important changes</title>
-			<para>
-			Starting with this version offline raster access and use of GDAL drivers
-			are disabled by default.
-			</para>
+      <para>
+      Starting with this version offline raster access and use of GDAL drivers
+      are disabled by default.
+      </para>
 
-			<para>
-			An environment variable is introduced to allow for enabling
-			specific GDAL drivers: POSTGIS_GDAL_ENABLED_DRIVERS.
-			By default, all GDAL drivers are disabled
-			</para>
+      <para>
+      An environment variable is introduced to allow for enabling
+      specific GDAL drivers: POSTGIS_GDAL_ENABLED_DRIVERS.
+      By default, all GDAL drivers are disabled
+      </para>
 
-			<para>
-			An environment variable is introduced to allow for enabling
-			out-db raster bands: POSTGIS_ENABLE_OUTDB_RASTERS.
-			By default, out-db raster bands are disabled
-			</para>
+      <para>
+      An environment variable is introduced to allow for enabling
+      out-db raster bands: POSTGIS_ENABLE_OUTDB_RASTERS.
+      By default, out-db raster bands are disabled
+      </para>
 
-			<para>
-			The environment variables must be set for the PostgreSQL process,
-			and determines the behavior of the whole cluster.
-			</para>
+      <para>
+      The environment variables must be set for the PostgreSQL process,
+      and determines the behavior of the whole cluster.
+      </para>
       </simplesect>
       <simplesect>
         <title>Bug Fixes</title>
-			<para><ulink url="http://trac.osgeo.org/postgis/ticket/2697">#2697</ulink>, invalid GeoJSON Polygon input crashes server process</para>
-			<para><ulink url="http://trac.osgeo.org/postgis/ticket/2700">#2700</ulink>, Fix dumping of higher-dimension datasets with null rows</para>
-			<para><ulink url="http://trac.osgeo.org/postgis/ticket/2706">#2706</ulink>, ST_DumpPoints of EMPTY geometries crashes server</para>
+      <para><ulink url="http://trac.osgeo.org/postgis/ticket/2697">#2697</ulink>, invalid GeoJSON Polygon input crashes server process</para>
+      <para><ulink url="http://trac.osgeo.org/postgis/ticket/2700">#2700</ulink>, Fix dumping of higher-dimension datasets with null rows</para>
+      <para><ulink url="http://trac.osgeo.org/postgis/ticket/2706">#2706</ulink>, ST_DumpPoints of EMPTY geometries crashes server</para>
       </simplesect>
     </sect1>
     <sect1>
@@ -439,11 +464,11 @@
 
 
     <sect1>
-		  <title>Release 2.1.0</title>
-		  <para>Release date: 2013/08/17</para>
-		  <para>This is a minor release addressing both bug fixes and performance and functionality enhancements addressing issues since 2.0.3 release.
-		If you are upgrading from 2.0+, only a soft upgrade is required.  If you are upgrading from 1.5 or earlier, a hard upgrade is required.</para>
-		<simplesect>
+      <title>Release 2.1.0</title>
+      <para>Release date: 2013/08/17</para>
+      <para>This is a minor release addressing both bug fixes and performance and functionality enhancements addressing issues since 2.0.3 release.
+    If you are upgrading from 2.0+, only a soft upgrade is required.  If you are upgrading from 1.5 or earlier, a hard upgrade is required.</para>
+    <simplesect>
     <title>Important / Breaking Changes</title>
      <para><ulink url="http://trac.osgeo.org/postgis/ticket/1653">#1653</ulink>, Removed srid parameter from ST_Resample(raster) and variants
                with reference raster no longer apply reference raster's SRID.</para>
@@ -666,8 +691,8 @@
   </simplesect>
     <simplesect><title>Known Issues</title>
       <para><ulink url="http://trac.osgeo.org/postgis/ticket/2111">#2111</ulink>, Raster bands can only reference the first 256 bands of out-db rasters</para>
-		</simplesect>
-	 </sect1>
+    </simplesect>
+   </sect1>
 
   <sect1>
    <title>Release 2.0.5</title>
@@ -695,7 +720,7 @@
    </simplesect>
   </sect1>
 
-	<sect1>
+  <sect1>
     <title>Release 2.0.4</title>
       <para>Release date: 2013/09/06</para>
       <para>This is a bug fix release, addressing issues that have been filed since the 2.0.3 release. If you are using PostGIS 2.0+ a soft upgrade is required.  For users of PostGIS 1.5 or below, a hard upgrade is required.</para>
@@ -738,11 +763,11 @@
   </sect1>
 
   <sect1>
-		<title>Release 2.0.3</title>
-		<para>Release date: 2013/03/01</para>
-		<para>This is a bug fix release, addressing issues that have been filed since the 2.0.2 release. If you are using PostGIS 2.0+ a soft upgrade is required.  For users of PostGIS 1.5 or below, a hard upgrade is required.</para>
-		<simplesect>
-			<title>Bug Fixes</title>
+    <title>Release 2.0.3</title>
+    <para>Release date: 2013/03/01</para>
+    <para>This is a bug fix release, addressing issues that have been filed since the 2.0.2 release. If you are using PostGIS 2.0+ a soft upgrade is required.  For users of PostGIS 1.5 or below, a hard upgrade is required.</para>
+    <simplesect>
+      <title>Bug Fixes</title>
   <para><ulink url="http://trac.osgeo.org/postgis/ticket/2126">#2126</ulink>, Better handling of empty rasters from ST_ConvexHull()</para>
   <para><ulink url="http://trac.osgeo.org/postgis/ticket/2134">#2134</ulink>, Make sure to process SRS before passing it off to GDAL functions</para>
   <para>Fix various memory leaks in liblwgeom</para>
@@ -754,136 +779,136 @@
   <para><ulink url="http://trac.osgeo.org/postgis/ticket/2188">#2188</ulink>, Fix function parameter value overflow that caused problems when copying data from a GDAL dataset</para>
   <para><ulink url="http://trac.osgeo.org/postgis/ticket/2216">#2216</ulink>, More memory errors in MultiPolygon GeoJSON parsing (with holes)</para>
   <para>Fix Memory leak in GeoJSON parser</para>
-		</simplesect>
-		<simplesect>
-			 <title>Enhancements</title>
+    </simplesect>
+    <simplesect>
+       <title>Enhancements</title>
   <para><ulink url="http://trac.osgeo.org/postgis/ticket/2141">#2141</ulink>, More verbose output when constraints fail to be added to a raster column</para>
   <para>Speedup ST_ChangeEdgeGeom</para>
-		</simplesect>
-	  </sect1>
+    </simplesect>
+    </sect1>
       <sect1>
-		<title>Release 2.0.2</title>
-		<para>Release date: 2012/12/03</para>
-		<para>This is a bug fix release, addressing issues that have been filed since the 2.0.1 release.</para>
-		<simplesect>
-			<title>Bug Fixes</title>
-			<para><ulink url="http://trac.osgeo.org/postgis/ticket/1287">#1287</ulink>, Drop of "gist_geometry_ops" broke a few clients
+    <title>Release 2.0.2</title>
+    <para>Release date: 2012/12/03</para>
+    <para>This is a bug fix release, addressing issues that have been filed since the 2.0.1 release.</para>
+    <simplesect>
+      <title>Bug Fixes</title>
+      <para><ulink url="http://trac.osgeo.org/postgis/ticket/1287">#1287</ulink>, Drop of "gist_geometry_ops" broke a few clients
      package of legacy_gist.sql for these cases</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1391">#1391</ulink>, Errors during upgrade from 1.5</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1828">#1828</ulink>, Poor selectivity estimate on ST_DWithin</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1838">#1838</ulink>, error importing tiger/line data</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1869">#1869</ulink>, ST_AsBinary is not unique added to legacy_minor/legacy.sql scripts</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1885">#1885</ulink>, Missing field from tabblock table in tiger2010 census_loader.sql</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1891">#1891</ulink>, Use LDFLAGS environment when building liblwgeom</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1900">#1900</ulink>, Fix pgsql2shp for big-endian systems </para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1932">#1932</ulink>, Fix raster2pgsql for invalid syntax for setting index tablespace</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1936">#1936</ulink>, ST_GeomFromGML on CurvePolygon causes server crash</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1955">#1955</ulink>, ST_ModEdgeHeal and ST_NewEdgeHeal for doubly connected edges</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1957">#1957</ulink>, ST_Distance to a one-point LineString returns NULL</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1976">#1976</ulink>, Geography point-in-ring code overhauled for more reliability</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1978">#1978</ulink>, wrong answer calculating length of closed circular arc (circle)</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1981">#1981</ulink>, Remove unused but set variables as found with gcc 4.6+</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1987">#1987</ulink>, Restore 1.5.x behaviour of ST_Simplify</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1989">#1989</ulink>, Preprocess input geometry to just intersection with raster
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1391">#1391</ulink>, Errors during upgrade from 1.5</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1828">#1828</ulink>, Poor selectivity estimate on ST_DWithin</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1838">#1838</ulink>, error importing tiger/line data</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1869">#1869</ulink>, ST_AsBinary is not unique added to legacy_minor/legacy.sql scripts</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1885">#1885</ulink>, Missing field from tabblock table in tiger2010 census_loader.sql</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1891">#1891</ulink>, Use LDFLAGS environment when building liblwgeom</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1900">#1900</ulink>, Fix pgsql2shp for big-endian systems </para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1932">#1932</ulink>, Fix raster2pgsql for invalid syntax for setting index tablespace</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1936">#1936</ulink>, ST_GeomFromGML on CurvePolygon causes server crash</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1955">#1955</ulink>, ST_ModEdgeHeal and ST_NewEdgeHeal for doubly connected edges</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1957">#1957</ulink>, ST_Distance to a one-point LineString returns NULL</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1976">#1976</ulink>, Geography point-in-ring code overhauled for more reliability</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1978">#1978</ulink>, wrong answer calculating length of closed circular arc (circle)</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1981">#1981</ulink>, Remove unused but set variables as found with gcc 4.6+</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1987">#1987</ulink>, Restore 1.5.x behaviour of ST_Simplify</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1989">#1989</ulink>, Preprocess input geometry to just intersection with raster
            to be clipped</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1991">#1991</ulink>, geocode really slow on PostgreSQL 9.2</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1996">#1996</ulink>, support POINT EMPTY in GeoJSON output</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1998">#1998</ulink>, Fix ST_{Mod,New}EdgeHeal joining edges sharing both endpoints</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/2001">#2001</ulink>, ST_CurveToLine has no effect if the geometry doesn't actually contain an arc</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/2015">#2015</ulink>, ST_IsEmpty('POLYGON(EMPTY)') returns False</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/2019">#2019</ulink>, ST_FlipCoordinates does not update bbox</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/2025">#2025</ulink>, Fix side location conflict at TopoGeo_AddLineString</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/2026">#2026</ulink>, improve performance of distance calculations</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/2033">#2033</ulink>, Fix adding a splitting point into a 2.5d topology </para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/2051">#2051</ulink>, Fix excess of precision in ST_AsGeoJSON output</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/2052">#2052</ulink>, Fix buffer overflow in lwgeom_to_geojson</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/2056">#2056</ulink>, Fixed lack of SRID check of raster and geometry in ST_SetValue()</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/2057">#2057</ulink>, Fixed linking issue for raster2psql to libpq</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/2060">#2060</ulink>, Fix "dimension" check violation by GetTopoGeomElementArray</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/2072">#2072</ulink>, Removed outdated checks preventing ST_Intersects(raster) from
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1991">#1991</ulink>, geocode really slow on PostgreSQL 9.2</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1996">#1996</ulink>, support POINT EMPTY in GeoJSON output</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1998">#1998</ulink>, Fix ST_{Mod,New}EdgeHeal joining edges sharing both endpoints</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/2001">#2001</ulink>, ST_CurveToLine has no effect if the geometry doesn't actually contain an arc</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/2015">#2015</ulink>, ST_IsEmpty('POLYGON(EMPTY)') returns False</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/2019">#2019</ulink>, ST_FlipCoordinates does not update bbox</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/2025">#2025</ulink>, Fix side location conflict at TopoGeo_AddLineString</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/2026">#2026</ulink>, improve performance of distance calculations</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/2033">#2033</ulink>, Fix adding a splitting point into a 2.5d topology </para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/2051">#2051</ulink>, Fix excess of precision in ST_AsGeoJSON output</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/2052">#2052</ulink>, Fix buffer overflow in lwgeom_to_geojson</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/2056">#2056</ulink>, Fixed lack of SRID check of raster and geometry in ST_SetValue()</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/2057">#2057</ulink>, Fixed linking issue for raster2psql to libpq</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/2060">#2060</ulink>, Fix "dimension" check violation by GetTopoGeomElementArray</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/2072">#2072</ulink>, Removed outdated checks preventing ST_Intersects(raster) from
            working on out-db bands</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/2077">#2077</ulink>, Fixed incorrect answers from ST_Hillshade(raster) </para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/2092">#2092</ulink>, Namespace issue with ST_GeomFromKML,ST_GeomFromGML for libxml 2.8+</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/2099">#2099</ulink>, Fix double free on exception in ST_OffsetCurve</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/2100">#2100</ulink>, ST_AsRaster() may not return raster with specified pixel type</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/2108">#2108</ulink>, Ensure ST_Line_Interpolate_Point always returns POINT</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/2109">#2109</ulink>, Ensure ST_Centroid always returns POINT</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/2117">#2117</ulink>, Ensure ST_PointOnSurface always returns POINT</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/2129">#2129</ulink>, Fix SRID in ST_Homogenize output with collection input</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/2077">#2077</ulink>, Fixed incorrect answers from ST_Hillshade(raster) </para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/2092">#2092</ulink>, Namespace issue with ST_GeomFromKML,ST_GeomFromGML for libxml 2.8+</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/2099">#2099</ulink>, Fix double free on exception in ST_OffsetCurve</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/2100">#2100</ulink>, ST_AsRaster() may not return raster with specified pixel type</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/2108">#2108</ulink>, Ensure ST_Line_Interpolate_Point always returns POINT</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/2109">#2109</ulink>, Ensure ST_Centroid always returns POINT</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/2117">#2117</ulink>, Ensure ST_PointOnSurface always returns POINT</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/2129">#2129</ulink>, Fix SRID in ST_Homogenize output with collection input</para>
        <para><ulink url="http://trac.osgeo.org/postgis/ticket/2130">#2130</ulink>, Fix memory error in MultiPolygon GeoJson parsing</para>
 
-			 <para>Update URL of Maven jar</para>
-		</simplesect>
-		<simplesect>
-			 <title>Enhancements</title>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1581">#1581</ulink>, ST_Clip(raster, ...) no longer imposes NODATA on a band if the
+       <para>Update URL of Maven jar</para>
+    </simplesect>
+    <simplesect>
+       <title>Enhancements</title>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1581">#1581</ulink>, ST_Clip(raster, ...) no longer imposes NODATA on a band if the
            corresponding band from the source raster did not have NODATA</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1928">#1928</ulink>, Accept array properties in GML input multi-geom input
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1928">#1928</ulink>, Accept array properties in GML input multi-geom input
     (Kashif Rasul and Shoaib Burq / SpacialDB)</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/2082">#2082</ulink>, Add indices on start_node and end_node of topology edge tables</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/2087">#2087</ulink>, Speedup topology.GetRingEdges using a recursive CTE</para>
-		</simplesect>
-	</sect1>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/2082">#2082</ulink>, Add indices on start_node and end_node of topology edge tables</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/2087">#2087</ulink>, Speedup topology.GetRingEdges using a recursive CTE</para>
+    </simplesect>
+  </sect1>
     <sect1>
-		<title>Release 2.0.1</title>
-		<para>Release date: 2012/06/22</para>
-		<para>This is a bug fix release, addressing issues that have been filed since the 2.0.0 release.</para>
-		<simplesect>
-			 <title>Bug Fixes</title>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1264">#1264</ulink>, fix st_dwithin(geog, geog, 0). </para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1468">#1468</ulink>  shp2pgsql-gui table column schema get shifted</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1694">#1694</ulink>, fix building with clang. (vince)</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1708">#1708</ulink>, improve restore of pre-PostGIS 2.0 backups.</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1714">#1714</ulink>, more robust handling of high topology tolerance.</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1755">#1755</ulink>, ST_GeographyFromText support for higher dimensions.</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1759">#1759</ulink>, loading transformed shapefiles in raster enabled db.</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1761">#1761</ulink>, handling of subdatasets in NetCDF, HDF4 and HDF5 in raster2pgsql.</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1763">#1763</ulink>, topology.toTopoGeom use with custom search_path.</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1766">#1766</ulink>, don't let ST_RemEdge* destroy peripheral TopoGeometry objects.</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1774">#1774</ulink>, Clearer error on setting an edge geometry to an invalid one.</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1775">#1775</ulink>, ST_ChangeEdgeGeom collision detection with 2-vertex target.</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1776">#1776</ulink>, fix ST_SymDifference(empty, geom) to return geom.</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1779">#1779</ulink>, install SQL comment files.</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1782">#1782</ulink>, fix spatial reference string handling in raster.</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1789">#1789</ulink>, fix false edge-node crossing report in ValidateTopology.</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1790">#1790</ulink>, fix toTopoGeom handling of duplicated primitives.</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1791">#1791</ulink>, fix ST_Azimuth with very close but distinct points.</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1797">#1797</ulink>, fix (ValidateTopology(xxx)).* syntax calls.</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1805">#1805</ulink>, put back the 900913 SRID entry.</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1813">#1813</ulink>, Only show readable relations in metadata tables.</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1819">#1819</ulink>, fix floating point issues with ST_World2RasterCoord and
-					   ST_Raster2WorldCoord variants.</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1820">#1820</ulink>  compilation on 9.2beta1.</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1822">#1822</ulink>, topology load on PostgreSQL 9.2beta1.</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1825">#1825</ulink>, fix prepared geometry cache lookup</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1829">#1829</ulink>, fix uninitialized read in GeoJSON parser</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1834">#1834</ulink>, revise postgis extension to only backup
-					   user specified spatial_ref_sys</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1839">#1839</ulink>, handling of subdatasets in GeoTIFF in raster2pgsql.</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1840">#1840</ulink>, fix logic of when to compute # of tiles in raster2pgsql.</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1851">#1851</ulink>, fix spatial_ref_system parameters for EPSG:3844</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1857">#1857</ulink>, fix failure to detect endpoint mismatch in ST_AddEdge*Face*</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1865">#1865</ulink>, data loss in postgis_restore.pl when data rows have leading
-					   dashes.</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1867">#1867</ulink>, catch invalid topology name passed to topogeo_add*</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1872">#1872</ulink>, fix ST_ApproxSummarystats to prevent division by zero</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1873">#1873</ulink>, fix ptarray_locate_point to return interpolated Z/M values for
-			              on-the-line case</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1875">#1875</ulink>, ST_SummaryStats returns NULL for all parameters except count
-			              when count is zero </para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1881">#1881</ulink>, shp2pgsql-gui -- editing a field sometimes triggers
-						  removing row</para>
-	 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1883">#1883</ulink>, Geocoder install fails trying to run
+    <title>Release 2.0.1</title>
+    <para>Release date: 2012/06/22</para>
+    <para>This is a bug fix release, addressing issues that have been filed since the 2.0.0 release.</para>
+    <simplesect>
+       <title>Bug Fixes</title>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1264">#1264</ulink>, fix st_dwithin(geog, geog, 0). </para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1468">#1468</ulink>  shp2pgsql-gui table column schema get shifted</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1694">#1694</ulink>, fix building with clang. (vince)</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1708">#1708</ulink>, improve restore of pre-PostGIS 2.0 backups.</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1714">#1714</ulink>, more robust handling of high topology tolerance.</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1755">#1755</ulink>, ST_GeographyFromText support for higher dimensions.</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1759">#1759</ulink>, loading transformed shapefiles in raster enabled db.</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1761">#1761</ulink>, handling of subdatasets in NetCDF, HDF4 and HDF5 in raster2pgsql.</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1763">#1763</ulink>, topology.toTopoGeom use with custom search_path.</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1766">#1766</ulink>, don't let ST_RemEdge* destroy peripheral TopoGeometry objects.</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1774">#1774</ulink>, Clearer error on setting an edge geometry to an invalid one.</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1775">#1775</ulink>, ST_ChangeEdgeGeom collision detection with 2-vertex target.</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1776">#1776</ulink>, fix ST_SymDifference(empty, geom) to return geom.</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1779">#1779</ulink>, install SQL comment files.</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1782">#1782</ulink>, fix spatial reference string handling in raster.</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1789">#1789</ulink>, fix false edge-node crossing report in ValidateTopology.</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1790">#1790</ulink>, fix toTopoGeom handling of duplicated primitives.</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1791">#1791</ulink>, fix ST_Azimuth with very close but distinct points.</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1797">#1797</ulink>, fix (ValidateTopology(xxx)).* syntax calls.</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1805">#1805</ulink>, put back the 900913 SRID entry.</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1813">#1813</ulink>, Only show readable relations in metadata tables.</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1819">#1819</ulink>, fix floating point issues with ST_World2RasterCoord and
+             ST_Raster2WorldCoord variants.</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1820">#1820</ulink>  compilation on 9.2beta1.</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1822">#1822</ulink>, topology load on PostgreSQL 9.2beta1.</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1825">#1825</ulink>, fix prepared geometry cache lookup</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1829">#1829</ulink>, fix uninitialized read in GeoJSON parser</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1834">#1834</ulink>, revise postgis extension to only backup
+             user specified spatial_ref_sys</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1839">#1839</ulink>, handling of subdatasets in GeoTIFF in raster2pgsql.</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1840">#1840</ulink>, fix logic of when to compute # of tiles in raster2pgsql.</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1851">#1851</ulink>, fix spatial_ref_system parameters for EPSG:3844</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1857">#1857</ulink>, fix failure to detect endpoint mismatch in ST_AddEdge*Face*</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1865">#1865</ulink>, data loss in postgis_restore.pl when data rows have leading
+             dashes.</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1867">#1867</ulink>, catch invalid topology name passed to topogeo_add*</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1872">#1872</ulink>, fix ST_ApproxSummarystats to prevent division by zero</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1873">#1873</ulink>, fix ptarray_locate_point to return interpolated Z/M values for
+                    on-the-line case</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1875">#1875</ulink>, ST_SummaryStats returns NULL for all parameters except count
+                    when count is zero </para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1881">#1881</ulink>, shp2pgsql-gui -- editing a field sometimes triggers
+              removing row</para>
+   <para><ulink url="http://trac.osgeo.org/postgis/ticket/1883">#1883</ulink>, Geocoder install fails trying to run
            create_census_base_tables() (Brian Panulla)</para>
-		</simplesect>
-		<simplesect>
-			 <title>Enhancements</title>
-				<para>More detailed exception message from topology editing functions.</para>
-				<para><ulink url="http://trac.osgeo.org/postgis/ticket/1786">#1786</ulink>, improved build dependencies</para>
-				<para><ulink url="http://trac.osgeo.org/postgis/ticket/1806">#1806</ulink>, speedup of ST_BuildArea, ST_MakeValid and ST_GetFaceGeometry.</para>
-				<para><ulink url="http://trac.osgeo.org/postgis/ticket/1812">#1812</ulink>, Add lwgeom_normalize in LIBLWGEOM for more stable testing.</para>
-		</simplesect>
-	  </sect1>
+    </simplesect>
+    <simplesect>
+       <title>Enhancements</title>
+        <para>More detailed exception message from topology editing functions.</para>
+        <para><ulink url="http://trac.osgeo.org/postgis/ticket/1786">#1786</ulink>, improved build dependencies</para>
+        <para><ulink url="http://trac.osgeo.org/postgis/ticket/1806">#1806</ulink>, speedup of ST_BuildArea, ST_MakeValid and ST_GetFaceGeometry.</para>
+        <para><ulink url="http://trac.osgeo.org/postgis/ticket/1812">#1812</ulink>, Add lwgeom_normalize in LIBLWGEOM for more stable testing.</para>
+    </simplesect>
+    </sect1>
       <sect1>
         <title>Release 2.0.0</title>
         <para>Release date: 2012/04/03</para>
@@ -891,39 +916,39 @@
         to <xref linkend="hard_upgrade" /> for details on upgrading.
         Refer to <xref linkend="NewFunctions_2_0" /> for more details and changed/new functions.</para>
        <simplesect>
-	<title>Testers - Our unsung heroes</title>
-	<para>We are most indebted to the numerous members in the PostGIS community
-	who were brave enough to test out the new features in this release.
-	No major release can be successful without these folk.</para>
-			<para>Below are those who have been most valiant, provided very detailed
-			and thorough bug reports,
-			and detailed analysis.</para>
+  <title>Testers - Our unsung heroes</title>
+  <para>We are most indebted to the numerous members in the PostGIS community
+  who were brave enough to test out the new features in this release.
+  No major release can be successful without these folk.</para>
+      <para>Below are those who have been most valiant, provided very detailed
+      and thorough bug reports,
+      and detailed analysis.</para>
 <simplelist>
-			<member>Andrea Peri - Lots of testing on topology, checking for correctness</member>
-			<member>Andreas Forø Tollefsen - raster testing</member>
-			<member>Chris English - topology stress testing loader functions</member>
-			<member>Salvatore Larosa - topology robustness testing</member>
-			<member>Brian Hamlin - Benchmarking
-				(also experimental experimental branches
-					before they are folded into core)
-				, general testing of various pieces
-			   including Tiger and Topology. Testing on various server VMs</member>
-			<member>Mike Pease -  Tiger geocoder testing - very detailed reports of issues</member>
-			<member>Tom van Tilburg - raster testing</member>
+      <member>Andrea Peri - Lots of testing on topology, checking for correctness</member>
+      <member>Andreas Forø Tollefsen - raster testing</member>
+      <member>Chris English - topology stress testing loader functions</member>
+      <member>Salvatore Larosa - topology robustness testing</member>
+      <member>Brian Hamlin - Benchmarking
+        (also experimental experimental branches
+          before they are folded into core)
+        , general testing of various pieces
+         including Tiger and Topology. Testing on various server VMs</member>
+      <member>Mike Pease -  Tiger geocoder testing - very detailed reports of issues</member>
+      <member>Tom van Tilburg - raster testing</member>
 </simplelist>
         </simplesect>
         <simplesect>
-	<title>Important / Breaking Changes</title>
-	<para><ulink url="http://trac.osgeo.org/postgis/ticket/722">#722</ulink>, <ulink url="http://trac.osgeo.org/postgis/ticket/302">#302</ulink>, Most deprecated functions removed (over 250 functions) (Regina Obe, Paul Ramsey)</para>
-	<para>Unknown SRID changed from -1 to 0. (Paul Ramsey)</para>
-	<para> -- (most deprecated in 1.2) removed non-ST variants buffer, length, intersects
-	 (and internal functions renamed) etc. </para>
-	<para>-- If you have been using deprecated functions CHANGE your apps or suffer the consequences.
+  <title>Important / Breaking Changes</title>
+  <para><ulink url="http://trac.osgeo.org/postgis/ticket/722">#722</ulink>, <ulink url="http://trac.osgeo.org/postgis/ticket/302">#302</ulink>, Most deprecated functions removed (over 250 functions) (Regina Obe, Paul Ramsey)</para>
+  <para>Unknown SRID changed from -1 to 0. (Paul Ramsey)</para>
+  <para> -- (most deprecated in 1.2) removed non-ST variants buffer, length, intersects
+   (and internal functions renamed) etc. </para>
+  <para>-- If you have been using deprecated functions CHANGE your apps or suffer the consequences.
      If you don't see a function documented -- it ain't supported or it is an internal function.
      Some constraints in older tables were built with deprecated functions.
      If you restore you may need to rebuild table constraints with populate_geometry_columns().  If you have applications or tools
-					that rely on deprecated functions, please refer to <xref linkend="legacy_faq" /> for more details.</para>
-		<para><ulink url="http://trac.osgeo.org/postgis/ticket/944">#944</ulink> geometry_columns is now a view instead of a table
+          that rely on deprecated functions, please refer to <xref linkend="legacy_faq" /> for more details.</para>
+    <para><ulink url="http://trac.osgeo.org/postgis/ticket/944">#944</ulink> geometry_columns is now a view instead of a table
     (Paul Ramsey, Regina Obe)
     for tables created the old way reads (srid, type, dims) constraints
     for geometry columns created with type modifiers
@@ -944,8 +969,8 @@
           <para><ulink url="http://blog.opengeo.org/2011/09/28/indexed-nearest-neighbour-search-in-postgis/">KNN Gist index based centroid (<->) and box (<#>) distance operators (Paul Ramsey / funded by Vizzuality)</ulink></para>
           <para>Support for TIN and PolyHedralSurface and enhancement of many functions to support 3D (Olivier Courtin / Oslandia)</para>
           <para><ulink url="http://trac.osgeo.org/postgis/wiki/WKTRaster/PlanningAndFunding">Raster support integrated and documented</ulink>
-		(Pierre Racine, Jorge Arévalo, Mateusz Loskot, Sandro Santilli, David Zwarg, Regina Obe, Bborie Park)
-		(Company developer and funding: University Laval, Deimos Space, CadCorp,  Michigan Tech Research Institute, Azavea, Paragon Corporation, UC Davis Center for Vectorborne Diseases)</para>
+    (Pierre Racine, Jorge Arévalo, Mateusz Loskot, Sandro Santilli, David Zwarg, Regina Obe, Bborie Park)
+    (Company developer and funding: University Laval, Deimos Space, CadCorp,  Michigan Tech Research Institute, Azavea, Paragon Corporation, UC Davis Center for Vectorborne Diseases)</para>
           <para>Making spatial indexes 3D aware - in progress (Paul Ramsey, Mark Cave-Ayland)</para>
           <para>Topology support improved (more functions), documented, testing (Sandro Santilli / Faunalia for RT-SIGTA), Andrea Peri, Regina Obe, Jose Carlos Martinez Llari</para>
           <para>3D relationship and measurement support functions  (Nicklas Avén)</para>
@@ -967,104 +992,104 @@
           <para><ulink url="http://blog.opengeo.org/2011/11/21/st_geomfromgeojson/">ST_GeomFromGeoJSON (Kashif Rasul, Paul Ramsey / Vizzuality funding)</ulink></para>
         </simplesect>
         <simplesect>
-	<title>Enhancements</title>
-	<para>Made shape file loader tolerant of truncated multibyte values found in some free worldwide shapefiles (Sandro Santilli)</para>
-	<para>Lots of bug fixes and enhancements to shp2pgsql
-	       Beefing up regression tests for loaders
-	       Reproject support for both geometry and geography during import
-	       (Jeff Adams / Azavea, Mark Cave-Ayland)</para>
-	<para>pgsql2shp conversion from predefined list
-	       (Loic Dachary / Mark Cave-Ayland)</para>
-	<para>Shp-pgsql GUI loader - support loading multiple files at a time.  (Mark Leslie)</para>
-	<para>Extras - upgraded tiger_geocoder from using old TIGER format to use new TIGER shp and file structure format (Stephen Frost)</para>
-	<para>Extras - revised tiger_geocoder to work with TIGER census 2010 data, addition of reverse geocoder function, various bug fixes, accuracy enhancements,
-	     limit max result return, speed improvements, loading routines.
-	   (Regina Obe, Leo Hsu / Paragon Corporation / funding provided by Hunter Systems Group)</para>
-	<para>Overall Documentation proofreading and corrections. (Kasif Rasul)</para>
-	<para>Cleanup PostGIS JDBC classes, revise to use Maven build. (Maria Arias de Reyna, Sandro Santilli)</para>
+  <title>Enhancements</title>
+  <para>Made shape file loader tolerant of truncated multibyte values found in some free worldwide shapefiles (Sandro Santilli)</para>
+  <para>Lots of bug fixes and enhancements to shp2pgsql
+         Beefing up regression tests for loaders
+         Reproject support for both geometry and geography during import
+         (Jeff Adams / Azavea, Mark Cave-Ayland)</para>
+  <para>pgsql2shp conversion from predefined list
+         (Loic Dachary / Mark Cave-Ayland)</para>
+  <para>Shp-pgsql GUI loader - support loading multiple files at a time.  (Mark Leslie)</para>
+  <para>Extras - upgraded tiger_geocoder from using old TIGER format to use new TIGER shp and file structure format (Stephen Frost)</para>
+  <para>Extras - revised tiger_geocoder to work with TIGER census 2010 data, addition of reverse geocoder function, various bug fixes, accuracy enhancements,
+       limit max result return, speed improvements, loading routines.
+     (Regina Obe, Leo Hsu / Paragon Corporation / funding provided by Hunter Systems Group)</para>
+  <para>Overall Documentation proofreading and corrections. (Kasif Rasul)</para>
+  <para>Cleanup PostGIS JDBC classes, revise to use Maven build. (Maria Arias de Reyna, Sandro Santilli)</para>
         </simplesect>
         <simplesect>
-	<title>Bug Fixes</title>
-	<para><ulink url="http://trac.osgeo.org/postgis/ticket/1335">#1335</ulink> ST_AddPoint returns incorrect result on Linux (Even Rouault)</para>
+  <title>Bug Fixes</title>
+  <para><ulink url="http://trac.osgeo.org/postgis/ticket/1335">#1335</ulink> ST_AddPoint returns incorrect result on Linux (Even Rouault)</para>
         </simplesect>
         <simplesect>
-	<title>Release specific credits</title>
+  <title>Release specific credits</title>
         <para>We thank <ulink url="http://blog.opengeo.org/2012/02/01/it-goes-up-to-2-0/">U.S Department of State Human Information Unit (HIU)</ulink> and <ulink url="http://blog.cartodb.com/post/17318840209/postgis-core-committer-sandro-santilli-joins-cartodb">Vizzuality</ulink> for general monetary support to get PostGIS 2.0 out the door.</para>
-		<!-- TODO: expand this list -->
-	</simplesect>
+    <!-- TODO: expand this list -->
+  </simplesect>
    </sect1>
    <sect1>
-		<title>Release 1.5.4</title>
-		<para>Release date: 2012/05/07</para>
-		<para>This is a bug fix release, addressing issues that have been filed since the 1.5.3 release.</para>
-		<simplesect>
-			 <title>Bug Fixes</title>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/547">#547</ulink>, ST_Contains memory problems (Sandro Santilli)</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/621">#621</ulink>, Problem finding intersections with geography (Paul Ramsey)</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/627">#627</ulink>, PostGIS/PostgreSQL process die on invalid geometry (Paul Ramsey)</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/810">#810</ulink>, Increase accuracy of area calculation (Paul Ramsey)</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/852">#852</ulink>, improve spatial predicates robustness (Sandro Santilli, Nicklas Avén)</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/877">#877</ulink>, ST_Estimated_Extent returns NULL on empty tables (Sandro Santilli)</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1028">#1028</ulink>, ST_AsSVG kills whole postgres server when fails (Paul Ramsey)</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1056">#1056</ulink>, Fix boxes of arcs and circle stroking code (Paul Ramsey)</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1121">#1121</ulink>, populate_geometry_columns using deprecated functions (Regin Obe, Paul Ramsey)</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1135">#1135</ulink>, improve testsuite predictability (Andreas 'ads' Scherbaum)</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1146">#1146</ulink>, images generator crashes (bronaugh)</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1170">#1170</ulink>, North Pole intersection fails (Paul Ramsey)</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1179">#1179</ulink>, ST_AsText crash with bad value (kjurka)</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1184">#1184</ulink>, honour DESTDIR in documentation Makefile (Bryce L Nordgren)</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1227">#1227</ulink>, server crash on invalid GML </para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1252">#1252</ulink>, SRID appearing in WKT (Paul Ramsey)</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1264">#1264</ulink>, st_dwithin(g, g, 0) doesn't work (Paul Ramsey)</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1344">#1344</ulink>, allow exporting tables with invalid geometries (Sandro Santilli)</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1389">#1389</ulink>, wrong proj4text for SRID 31300 and 31370 (Paul Ramsey)</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1406">#1406</ulink>, shp2pgsql crashes when loading into geography (Sandro Santilli)</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1595">#1595</ulink>, fixed SRID redundancy in ST_Line_SubString (Sandro Santilli)</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1596">#1596</ulink>, check SRID in UpdateGeometrySRID (Mike Toews, Sandro Santilli)</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1602">#1602</ulink>, fix ST_Polygonize to retain Z (Sandro Santilli)</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1697">#1697</ulink>, fix crash with EMPTY entries in GiST index (Paul Ramsey)</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1772">#1772</ulink>, fix ST_Line_Locate_Point with collapsed input (Sandro Santilli)</para>
-			 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1799">#1799</ulink>, Protect ST_Segmentize from max_length=0  (Sandro Santilli)</para>
-			 <para>Alter parameter order in 900913 (Paul Ramsey)</para>
-			 <para>Support builds with "gmake" (Greg Troxel)</para>
-		</simplesect>
-	</sect1>
+    <title>Release 1.5.4</title>
+    <para>Release date: 2012/05/07</para>
+    <para>This is a bug fix release, addressing issues that have been filed since the 1.5.3 release.</para>
+    <simplesect>
+       <title>Bug Fixes</title>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/547">#547</ulink>, ST_Contains memory problems (Sandro Santilli)</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/621">#621</ulink>, Problem finding intersections with geography (Paul Ramsey)</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/627">#627</ulink>, PostGIS/PostgreSQL process die on invalid geometry (Paul Ramsey)</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/810">#810</ulink>, Increase accuracy of area calculation (Paul Ramsey)</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/852">#852</ulink>, improve spatial predicates robustness (Sandro Santilli, Nicklas Avén)</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/877">#877</ulink>, ST_Estimated_Extent returns NULL on empty tables (Sandro Santilli)</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1028">#1028</ulink>, ST_AsSVG kills whole postgres server when fails (Paul Ramsey)</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1056">#1056</ulink>, Fix boxes of arcs and circle stroking code (Paul Ramsey)</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1121">#1121</ulink>, populate_geometry_columns using deprecated functions (Regin Obe, Paul Ramsey)</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1135">#1135</ulink>, improve testsuite predictability (Andreas 'ads' Scherbaum)</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1146">#1146</ulink>, images generator crashes (bronaugh)</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1170">#1170</ulink>, North Pole intersection fails (Paul Ramsey)</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1179">#1179</ulink>, ST_AsText crash with bad value (kjurka)</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1184">#1184</ulink>, honour DESTDIR in documentation Makefile (Bryce L Nordgren)</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1227">#1227</ulink>, server crash on invalid GML </para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1252">#1252</ulink>, SRID appearing in WKT (Paul Ramsey)</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1264">#1264</ulink>, st_dwithin(g, g, 0) doesn't work (Paul Ramsey)</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1344">#1344</ulink>, allow exporting tables with invalid geometries (Sandro Santilli)</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1389">#1389</ulink>, wrong proj4text for SRID 31300 and 31370 (Paul Ramsey)</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1406">#1406</ulink>, shp2pgsql crashes when loading into geography (Sandro Santilli)</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1595">#1595</ulink>, fixed SRID redundancy in ST_Line_SubString (Sandro Santilli)</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1596">#1596</ulink>, check SRID in UpdateGeometrySRID (Mike Toews, Sandro Santilli)</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1602">#1602</ulink>, fix ST_Polygonize to retain Z (Sandro Santilli)</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1697">#1697</ulink>, fix crash with EMPTY entries in GiST index (Paul Ramsey)</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1772">#1772</ulink>, fix ST_Line_Locate_Point with collapsed input (Sandro Santilli)</para>
+       <para><ulink url="http://trac.osgeo.org/postgis/ticket/1799">#1799</ulink>, Protect ST_Segmentize from max_length=0  (Sandro Santilli)</para>
+       <para>Alter parameter order in 900913 (Paul Ramsey)</para>
+       <para>Support builds with "gmake" (Greg Troxel)</para>
+    </simplesect>
+  </sect1>
 
       <sect1>
         <title>Release 1.5.3</title>
         <para>Release date: 2011/06/25</para>
         <para>This is a bug fix release, addressing issues that have been filed since the 1.5.2 release. If you are running PostGIS 1.3+, a soft upgrade is sufficient
-	otherwise a hard upgrade is recommended.</para>
+  otherwise a hard upgrade is recommended.</para>
         <simplesect>
           <title>Bug Fixes</title>
                 <para><ulink url="http://trac.osgeo.org/postgis/ticket/1056">#1056</ulink>, produce correct bboxes for arc geometries, fixes index errors
                     (Paul Ramsey)</para>
-			   <para><ulink url="http://trac.osgeo.org/postgis/ticket/1007">#1007</ulink>, ST_IsValid crash fix requires GEOS 3.3.0+ or 3.2.3+
-				 (Sandro Santilli, reported by Birgit Laggner)</para>
-			   <para><ulink url="http://trac.osgeo.org/postgis/ticket/940">#940</ulink>, support for PostgreSQL 9.1 beta 1
-				 (Regina Obe, Paul Ramsey, patch submitted by stl)</para>
-			   <para><ulink url="http://trac.osgeo.org/postgis/ticket/845">#845</ulink>, ST_Intersects precision error (Sandro Santilli, Nicklas Avén)
-				 Reported by cdestigter</para>
-			   <para><ulink url="http://trac.osgeo.org/postgis/ticket/884">#884</ulink>, Unstable results with ST_Within, ST_Intersects (Chris Hodgson)</para>
-			   <para><ulink url="http://trac.osgeo.org/postgis/ticket/779">#779</ulink>, shp2pgsql -S option seems to fail on points (Jeff Adams)</para>
-			   <para><ulink url="http://trac.osgeo.org/postgis/ticket/666">#666</ulink>, ST_DumpPoints is not null safe (Regina Obe)</para>
-			   <para><ulink url="http://trac.osgeo.org/postgis/ticket/631">#631</ulink>, Update NZ projections for grid transformation support (jpalmer)</para>
-			   <para><ulink url="http://trac.osgeo.org/postgis/ticket/630">#630</ulink>, Peculiar Null treatment in arrays in ST_Collect (Chris Hodgson)
-				 Reported by David Bitner</para>
-			   <para><ulink url="http://trac.osgeo.org/postgis/ticket/624">#624</ulink>, Memory leak in ST_GeogFromText (ryang, Paul Ramsey)</para>
-			   <para><ulink url="http://trac.osgeo.org/postgis/ticket/609">#609</ulink>, Bad source code in manual section 5.2 Java Clients (simoc, Regina Obe)</para>
-			   <para><ulink url="http://trac.osgeo.org/postgis/ticket/604">#604</ulink>, shp2pgsql usage touchups (Mike Toews, Paul Ramsey)</para>
-			   <para><ulink url="http://trac.osgeo.org/postgis/ticket/573">#573</ulink> ST_Union fails on a group of linestrings
-				 Not a PostGIS bug, fixed in GEOS 3.3.0</para>
-			   <para><ulink url="http://trac.osgeo.org/postgis/ticket/457">#457</ulink> ST_CollectionExtract returns non-requested type
-				(Nicklas Avén, Paul Ramsey)</para>
-			  <para><ulink url="http://trac.osgeo.org/postgis/ticket/441">#441</ulink> ST_AsGeoJson Bbox on GeometryCollection error (Olivier Courtin)</para>
-			  <para><ulink url="http://trac.osgeo.org/postgis/ticket/411">#411</ulink> Ability to backup invalid geometries (Sando Santilli)
-				 Reported by Regione Toscana</para>
-			  <para><ulink url="http://trac.osgeo.org/postgis/ticket/409">#409</ulink> ST_AsSVG - degraded (Olivier Courtin)
-				 Reported by Sdikiy</para>
-			  <para><ulink url="http://trac.osgeo.org/postgis/ticket/373">#373</ulink> Documentation syntax error in hard upgrade (Paul Ramsey)
-				 Reported by psvensso</para>
+         <para><ulink url="http://trac.osgeo.org/postgis/ticket/1007">#1007</ulink>, ST_IsValid crash fix requires GEOS 3.3.0+ or 3.2.3+
+         (Sandro Santilli, reported by Birgit Laggner)</para>
+         <para><ulink url="http://trac.osgeo.org/postgis/ticket/940">#940</ulink>, support for PostgreSQL 9.1 beta 1
+         (Regina Obe, Paul Ramsey, patch submitted by stl)</para>
+         <para><ulink url="http://trac.osgeo.org/postgis/ticket/845">#845</ulink>, ST_Intersects precision error (Sandro Santilli, Nicklas Avén)
+         Reported by cdestigter</para>
+         <para><ulink url="http://trac.osgeo.org/postgis/ticket/884">#884</ulink>, Unstable results with ST_Within, ST_Intersects (Chris Hodgson)</para>
+         <para><ulink url="http://trac.osgeo.org/postgis/ticket/779">#779</ulink>, shp2pgsql -S option seems to fail on points (Jeff Adams)</para>
+         <para><ulink url="http://trac.osgeo.org/postgis/ticket/666">#666</ulink>, ST_DumpPoints is not null safe (Regina Obe)</para>
+         <para><ulink url="http://trac.osgeo.org/postgis/ticket/631">#631</ulink>, Update NZ projections for grid transformation support (jpalmer)</para>
+         <para><ulink url="http://trac.osgeo.org/postgis/ticket/630">#630</ulink>, Peculiar Null treatment in arrays in ST_Collect (Chris Hodgson)
+         Reported by David Bitner</para>
+         <para><ulink url="http://trac.osgeo.org/postgis/ticket/624">#624</ulink>, Memory leak in ST_GeogFromText (ryang, Paul Ramsey)</para>
+         <para><ulink url="http://trac.osgeo.org/postgis/ticket/609">#609</ulink>, Bad source code in manual section 5.2 Java Clients (simoc, Regina Obe)</para>
+         <para><ulink url="http://trac.osgeo.org/postgis/ticket/604">#604</ulink>, shp2pgsql usage touchups (Mike Toews, Paul Ramsey)</para>
+         <para><ulink url="http://trac.osgeo.org/postgis/ticket/573">#573</ulink> ST_Union fails on a group of linestrings
+         Not a PostGIS bug, fixed in GEOS 3.3.0</para>
+         <para><ulink url="http://trac.osgeo.org/postgis/ticket/457">#457</ulink> ST_CollectionExtract returns non-requested type
+        (Nicklas Avén, Paul Ramsey)</para>
+        <para><ulink url="http://trac.osgeo.org/postgis/ticket/441">#441</ulink> ST_AsGeoJson Bbox on GeometryCollection error (Olivier Courtin)</para>
+        <para><ulink url="http://trac.osgeo.org/postgis/ticket/411">#411</ulink> Ability to backup invalid geometries (Sando Santilli)
+         Reported by Regione Toscana</para>
+        <para><ulink url="http://trac.osgeo.org/postgis/ticket/409">#409</ulink> ST_AsSVG - degraded (Olivier Courtin)
+         Reported by Sdikiy</para>
+        <para><ulink url="http://trac.osgeo.org/postgis/ticket/373">#373</ulink> Documentation syntax error in hard upgrade (Paul Ramsey)
+         Reported by psvensso</para>
         </simplesect>
       </sect1>
 
@@ -1072,7 +1097,7 @@
         <title>Release 1.5.2</title>
         <para>Release date: 2010/09/27</para>
         <para>This is a bug fix release, addressing issues that have been filed since the 1.5.1 release. If you are running PostGIS 1.3+, a soft upgrade is sufficient
-	otherwise a hard upgrade is recommended.</para>
+  otherwise a hard upgrade is recommended.</para>
         <simplesect>
           <title>Bug Fixes</title>
            <para>Loader: fix handling of empty (0-verticed) geometries in shapefiles. (Sandro Santilli)</para>
@@ -1103,7 +1128,7 @@
         <title>Release 1.5.1</title>
         <para>Release date: 2010/03/11</para>
         <para>This is a bug fix release, addressing issues that have been filed since the 1.4.1 release. If you are running PostGIS 1.3+, a soft upgrade is sufficient
-	otherwise a hard upgrade is recommended.</para>
+  otherwise a hard upgrade is recommended.</para>
         <simplesect>
           <title>Bug Fixes</title>
            <para><ulink url="http://trac.osgeo.org/postgis/ticket/410">#410</ulink>, update embedded bbox when applying ST_SetPoint, ST_AddPoint ST_RemovePoint to a linestring (Paul Ramsey)</para>
@@ -1145,13 +1170,13 @@
           <para>Added Hausdorff distance calculations (<ulink url="http://trac.osgeo.org/postgis/ticket/209">#209</ulink>) (Vincent Picavet)</para>
           <para>Added parameters argument to ST_Buffer operation to support one-sided buffering and other buffering styles (Sandro Santilli)</para>
           <para>Addition of other Distance related visualization and analysis functions (Nicklas Aven)</para>
-	  <itemizedlist>
-		<listitem><para>ST_ClosestPoint</para></listitem>
-		<listitem><para>ST_DFullyWithin</para></listitem>
-		<listitem><para>ST_LongestLine</para></listitem>
-		<listitem><para>ST_MaxDistance</para></listitem>
-		<listitem><para>ST_ShortestLine</para></listitem>
-	  </itemizedlist>
+    <itemizedlist>
+    <listitem><para>ST_ClosestPoint</para></listitem>
+    <listitem><para>ST_DFullyWithin</para></listitem>
+    <listitem><para>ST_LongestLine</para></listitem>
+    <listitem><para>ST_MaxDistance</para></listitem>
+    <listitem><para>ST_ShortestLine</para></listitem>
+    </itemizedlist>
           <para>ST_DumpPoints (Maxime van Noppen)</para>
           <para>KML, GML input via ST_GeomFromGML and ST_GeomFromKML (Olivier Courtin)</para>
           <para>Extract homogeneous collection with ST_CollectionExtract (Paul Ramsey)</para>
@@ -1188,7 +1213,7 @@
         <para>Release date: 2009/07/24</para>
         <para>This release provides performance enhancements, improved internal structures and testing, new features, and upgraded documentation.
         If you are running PostGIS 1.1+, a soft upgrade is sufficient
-	otherwise a hard upgrade is recommended.</para>
+  otherwise a hard upgrade is recommended.</para>
 
         <simplesect>
           <title>API Stability</title>
@@ -1249,11 +1274,11 @@
         </simplesect>
       </sect1>
 
-	  <sect1>
+    <sect1>
         <title>Release 1.3.6</title>
         <para>Release date: 2009/05/04</para>
         <para>If you are running PostGIS 1.1+, a soft upgrade is sufficient
-	otherwise a hard upgrade is recommended. This release adds support for PostgreSQL 8.4, exporting
+  otherwise a hard upgrade is recommended. This release adds support for PostgreSQL 8.4, exporting
         prj files from the database with shape data, some crash fixes for shp2pgsql, and several small
         bug fixes in the handling of "curve" types, logical error importing dbf only files, improved error handling of AddGeometryColumns.</para>
       </sect1>
@@ -1262,7 +1287,7 @@
         <title>Release 1.3.5</title>
         <para>Release date: 2008/12/15</para>
         <para>If you are running PostGIS 1.1+, a soft upgrade is sufficient
-	otherwise a hard upgrade is recommended. This release is a bug fix release to address a failure
+  otherwise a hard upgrade is recommended. This release is a bug fix release to address a failure
         in ST_Force_Collection and related functions that critically
         affects using MapServer with LINE layers.</para>
       </sect1>
diff --git a/doc/topology_comments.sql b/doc/topology_comments.sql
index 3ddb720..15232e9 100644
--- a/doc/topology_comments.sql
+++ b/doc/topology_comments.sql
@@ -27,9 +27,9 @@ COMMENT ON FUNCTION topology.CreateTopology(varchar ) IS 'args: topology_schema_
 			
 COMMENT ON FUNCTION topology.CreateTopology(varchar , integer ) IS 'args: topology_schema_name, srid - Creates a new topology schema and registers this new schema in the topology.topology table.';
 			
-COMMENT ON FUNCTION topology.CreateTopology(varchar , integer , double precision ) IS 'args: topology_schema_name, srid, tolerance - Creates a new topology schema and registers this new schema in the topology.topology table.';
+COMMENT ON FUNCTION topology.CreateTopology(varchar , integer , double precision ) IS 'args: topology_schema_name, srid, prec - Creates a new topology schema and registers this new schema in the topology.topology table.';
 			
-COMMENT ON FUNCTION topology.CreateTopology(varchar , integer , double precision , boolean ) IS 'args: topology_schema_name, srid, tolerance, hasz - Creates a new topology schema and registers this new schema in the topology.topology table.';
+COMMENT ON FUNCTION topology.CreateTopology(varchar , integer , double precision , boolean ) IS 'args: topology_schema_name, srid, prec, hasz - Creates a new topology schema and registers this new schema in the topology.topology table.';
 			
 COMMENT ON FUNCTION topology.CopyTopology(varchar , varchar ) IS 'args: existing_topology_name, new_name - Makes a copy of a topology structure (nodes, edges, faces, layers and TopoGeometries).';
 			
diff --git a/doc/using_postgis_dataman.xml b/doc/using_postgis_dataman.xml
index ee91e67..c908163 100644
--- a/doc/using_postgis_dataman.xml
+++ b/doc/using_postgis_dataman.xml
@@ -2184,7 +2184,7 @@ SELECT UPDATE_GEOMETRY_STATS([table_name], [column_name]);</programlisting></par
 	  <para>BRIN stands for "Block Range Index" and is a generic form of
 	  indexing that has been introduced in PostgreSQL 9.5. BRIN is a lossy kind
 	  of index, and its main usage is to provide a compromise for both read and
-	  write performance. It's primary goal is to handle very large tables for
+	  write performance. Its primary goal is to handle very large tables for
 	  which some of the columns have some natural correlation with their
 	  physical location within the table.  In addition to GIS indexing, BRIN is
 	  used to speed up searches on various kinds of regular or irregular data
@@ -2221,13 +2221,22 @@ SELECT UPDATE_GEOMETRY_STATS([table_name], [column_name]);</programlisting></par
 	  follows:</para>
 
 	  <para><programlisting>CREATE INDEX [indexname] ON [tablename] USING BRIN ( [geometryfield] ); </programlisting></para>
-	  <para>The above syntax will always build a 2D-index.  To get the 3d-dimensional index supported in PostGIS 2.0+ for the geometry type, you can create one using this syntax</para>
+	  <para>The above syntax will always build a 2D-index.  To get a 3d-dimensional index, you can create one using this syntax</para>
 	  <programlisting>CREATE INDEX [indexname] ON [tablename] USING BRIN ([geometryfield] brin_geometry_inclusion_ops_3d);</programlisting>
-	  <para>These above syntaxes will use the default number or block in a range, which is 128. To specify the number of blocks you want to summarise in a range, you can create one using this syntax</para>
-	  <para><programlisting>CREATE INDEX [indexname] ON [tablename] USING BRIN ( [geometryfield] ) WITH (pages_per_range = [number]); </programlisting></para>
+      <para>You can also get a 4d-dimensional index using the 4d operator class</para>
+	  <programlisting>CREATE INDEX [indexname] ON [tablename] USING BRIN ([geometryfield] brin_geometry_inclusion_ops_4d);</programlisting>
+      <para>These above syntaxes will use the default number or block in a range, which is 128. To specify the number of blocks you want to summarise in a range, you can create one using this syntax</para>
+      <para><programlisting>CREATE INDEX [indexname] ON [tablename] USING BRIN ( [geometryfield] ) WITH (pages_per_range = [number]); </programlisting></para>
+      <para>Also, keep in mind that a BRIN index will only store one index
+        value for a large number of rows.  If your table stores geometries with
+        a mixed number of dimensions, it's likely that the resulting index will
+        have poor performance.  You can avoid this drop of performance by
+        choosing the operator class whith the least number of dimensions of the
+        stored geometries
+      </para>
 
           <para>Also the "geography" datatype is supported for BRIN indexing. The
-          syntax for building a BRIN index on a "geometry" column is as follows:</para>
+          syntax for building a BRIN index on a "geography" column is as follows:</para>
 
           <para><programlisting>CREATE INDEX [indexname] ON [tablename] USING BRIN ( [geographyfield] ); </programlisting></para>
           <para>The above syntax will always build a 2D-index for geospatial objetcs on the spheroid. </para>
diff --git a/extensions/address_standardizer/Makefile b/extensions/address_standardizer/Makefile
index edcac90..026fcdf 100644
--- a/extensions/address_standardizer/Makefile
+++ b/extensions/address_standardizer/Makefile
@@ -25,19 +25,19 @@ OBJS_test_main = \
     standard.o \
     tokenize.o
 
-POSTGIS_PGSQL_VERSION=95
+POSTGIS_PGSQL_VERSION=96
 # SQL preprocessor
 SQLPP = /usr/bin/cpp -traditional-cpp -w -P
 GREP=/bin/grep
 PERL=/usr/bin/perl
-EXTVERSION    = 2.3.0
+EXTVERSION    = 2.3.1
 MINORVERSION  = 2.3
 MODULE_big = address_standardizer-2.3
 EXTENSION = address_standardizer
 DATA = address_standardizer_data_us.control sql/$(EXTENSION).sql sql/$(EXTENSION)_data_us.sql
 
 all:  sql/address_standardizer.sql sql/address_standardizer--1.0--$(EXTVERSION).sql sql/address_standardizer--$(EXTVERSION).sql sql/address_standardizer--$(EXTVERSION)--$(EXTVERSION)next.sql sql/address_standardizer--$(EXTVERSION)next--$(EXTVERSION).sql \
- sql/$(EXTENSION)_data_us.sql sql/address_standardizer--2.3.0.sql sql/$(EXTENSION)_data_us--2.3.0.sql  sql/$(EXTENSION)_data_us--$(EXTVERSION)--$(EXTVERSION)next.sql \
+ sql/$(EXTENSION)_data_us.sql sql/address_standardizer--2.3.1.sql sql/$(EXTENSION)_data_us--2.3.1.sql  sql/$(EXTENSION)_data_us--$(EXTVERSION)--$(EXTVERSION)next.sql \
 sql/$(EXTENSION)_data_us--$(EXTVERSION)next--$(EXTVERSION).sql \
 sql/test-init-extensions.sql sql/test-parseaddress.sql sql/test-standardize_address_1.sql sql/test-standardize_address_2.sql
 
@@ -46,14 +46,14 @@ EXTRA_CLEAN += sql/*.sql
 
 
 DOCS = README.address_standardizer
-PG_CPPFLAGS =  -I/var/lib/jenkins/workspace/geos/rel-3.5.1devw64/include  -I/usr/include/libxml2 -I/usr/include -DHAVE_SFCGAL   -I/var/lib/jenkins/workspace/pg/rel/pg9.5w64/pg9.5/include -g -O0
+PG_CPPFLAGS =  -I/var/lib/jenkins/workspace/geos/rel-3.6.1devw64/include  -I/usr/include/libxml2 -I/usr/include -DHAVE_SFCGAL   -I/var/lib/jenkins/workspace/pg/rel/pg9.6w64/pg9.6/include -g -O0
 
-SHLIB_LINK =  -L/var/lib/jenkins/workspace/geos/rel-3.5.1devw64/lib  -lgeos_c -lproj  -ljson-c -lxml2 -L/usr/lib/x86_64-linux-gnu -lSFCGAL  -Wl,--exclude-libs,ALL -lpcre
+SHLIB_LINK =  -L/var/lib/jenkins/workspace/geos/rel-3.6.1devw64/lib  -lgeos_c -lproj  -ljson-c -lxml2 -L/usr/lib/x86_64-linux-gnu -lSFCGAL  -Wl,--exclude-libs,ALL -lpcre
 EXTRA_CLEAN = usps-st-city-name.txt mk-st-regexp mk-city-regex test_main
 REGRESS = test-init-extensions test-parseaddress test-standardize_address_1 test-standardize_address_2
 
 # PGXS information
-PG_CONFIG = /var/lib/jenkins/workspace/pg/rel/pg9.5w64/bin/pg_config
+PG_CONFIG = /var/lib/jenkins/workspace/pg/rel/pg9.6w64/bin/pg_config
 
 PGVER := $(shell $(PG_CONFIG) --version)
 
@@ -68,7 +68,7 @@ sql/%.sql: %.sql.in
 	$(SQLPP) -I../libpgcommon $< | grep -v '^#' | \
 	$(PERL) -lpe "s'MODULE_PATHNAME'\$$libdir/${EXTENSION}-${MINORVERSION}'g" > $@
 	
-sql/address_standardizer--2.3.0.sql: sql/address_standardizer_types.sql \
+sql/address_standardizer--2.3.1.sql: sql/address_standardizer_types.sql \
     sql/address_standardizer_functions.sql
 	cat $^ > $@
 	
@@ -168,6 +168,6 @@ EXTRA_CLEAN += $(wildcard expected/*--*.out)
 EXTRA_CLEAN += sql/$(EXTENSION)--$(EXTVERSION).sql sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql
 EXTRA_CLEAN += sql/$(EXTENSION)--$(EXTVERSION).sql sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql *.a *.so *.dll
 
-PGXS := /var/lib/jenkins/workspace/pg/rel/pg9.5w64/lib/postgresql/pgxs/src/makefiles/pgxs.mk
+PGXS := /var/lib/jenkins/workspace/pg/rel/pg9.6w64/lib/postgresql/pgxs/src/makefiles/pgxs.mk
 include $(PGXS)
 PERL = /usr/bin/perl
diff --git a/extensions/address_standardizer/address_standardizer.control b/extensions/address_standardizer/address_standardizer.control
index 83b0c1c..6a5a76c 100644
--- a/extensions/address_standardizer/address_standardizer.control
+++ b/extensions/address_standardizer/address_standardizer.control
@@ -1,4 +1,4 @@
 # address_standardizer extension
 comment = 'Used to parse an address into constituent elements. Generally used to support geocoding address normalization step.'
-default_version = '2.3.0'
+default_version = '2.3.1'
 relocatable = true
diff --git a/extensions/address_standardizer/address_standardizer_data_us.control b/extensions/address_standardizer/address_standardizer_data_us.control
index 0561c1a..6c5c17a 100644
--- a/extensions/address_standardizer/address_standardizer_data_us.control
+++ b/extensions/address_standardizer/address_standardizer_data_us.control
@@ -1,4 +1,4 @@
 # address standardizer us dataset
 comment = 'Address Standardizer US dataset example'
-default_version = '2.3.0'
+default_version = '2.3.1'
 relocatable = true
diff --git a/extensions/postgis/Makefile b/extensions/postgis/Makefile
index 9d53434..0dd31f1 100644
--- a/extensions/postgis/Makefile
+++ b/extensions/postgis/Makefile
@@ -1,7 +1,7 @@
 include ../upgradeable_versions.mk
 
 EXTENSION     = postgis
-EXTVERSION    = 2.3.0
+EXTVERSION    = 2.3.1
 MINORVERSION  = 2.3
 GREP = /bin/grep
 PERL = /usr/bin/perl
@@ -25,7 +25,7 @@ PREREL_PREFIX = $(shell echo $(EXTVERSION) | \
 DATA         = $(filter-out $(wildcard sql/*--*.sql),$(wildcard sql/*.sql))
 
 #DOCS         = $(wildcard ../../doc/html/*.html)
-PG_CONFIG    = /var/lib/jenkins/workspace/pg/rel/pg9.5w64/bin/pg_config
+PG_CONFIG    = /var/lib/jenkins/workspace/pg/rel/pg9.6w64/bin/pg_config
 
 PG91         = $(shell $(PG_CONFIG) --version | $(GREP) -qE " 8\.| 9\.0" && echo no || echo yes)
 SQL_BITS     = $(wildcard sql_bits/*.sql)
diff --git a/extensions/postgis/postgis.control b/extensions/postgis/postgis.control
index cc270c4..f15c2f3 100644
--- a/extensions/postgis/postgis.control
+++ b/extensions/postgis/postgis.control
@@ -1,5 +1,5 @@
 # postgis extension
 comment = 'PostGIS geometry, geography, and raster spatial types and functions'
-default_version = '2.3.0'
+default_version = '2.3.1'
 module_pathname = '$libdir/postgis-2.3'
 relocatable = false
diff --git a/extensions/postgis_sfcgal/Makefile b/extensions/postgis_sfcgal/Makefile
index 731f8c1..de04b48 100644
--- a/extensions/postgis_sfcgal/Makefile
+++ b/extensions/postgis_sfcgal/Makefile
@@ -1,7 +1,7 @@
 include ../upgradeable_versions.mk
 
 EXTENSION    = postgis_sfcgal
-EXTVERSION    = 2.3.0
+EXTVERSION    = 2.3.1
 MINORVERSION  = 2.3
 GREP = /bin/grep
 PERL = /usr/bin/perl
@@ -24,7 +24,7 @@ PREREL_PREFIX = $(shell echo $(EXTVERSION) | \
 
 DATA         = $(filter-out $(wildcard sql/*--*.sql),$(wildcard sql/*.sql))
 
-PG_CONFIG    =  /var/lib/jenkins/workspace/pg/rel/pg9.5w64/bin/pg_config
+PG_CONFIG    =  /var/lib/jenkins/workspace/pg/rel/pg9.6w64/bin/pg_config
 
 PG91         = $(shell $(PG_CONFIG) --version | $(GREP) -qE " 8\.| 9\.0" && echo no || echo yes)
 SQL_BITS     = $(wildcard sql_bits/*.sql)
diff --git a/extensions/postgis_sfcgal/postgis_sfcgal.control b/extensions/postgis_sfcgal/postgis_sfcgal.control
index 012f4dd..23dd8e0 100644
--- a/extensions/postgis_sfcgal/postgis_sfcgal.control
+++ b/extensions/postgis_sfcgal/postgis_sfcgal.control
@@ -1,5 +1,5 @@
 # postgis topology extension
 comment = 'PostGIS SFCGAL functions'
-default_version = '2.3.0'
+default_version = '2.3.1'
 relocatable = true
 requires = postgis
diff --git a/extensions/postgis_tiger_geocoder/Makefile b/extensions/postgis_tiger_geocoder/Makefile
index 243912f..ab65cf4 100644
--- a/extensions/postgis_tiger_geocoder/Makefile
+++ b/extensions/postgis_tiger_geocoder/Makefile
@@ -1,7 +1,7 @@
 include ../upgradeable_versions.mk
 
 EXTENSION    = postgis_tiger_geocoder
-EXTVERSION    = 2.3.0
+EXTVERSION    = 2.3.1
 MINORVERSION  = 2011.2.3
 GREP = /bin/grep
 PERL = /usr/bin/perl
@@ -26,7 +26,7 @@ DATA         = $(filter-out $(wildcard sql/*--*.sql),$(wildcard sql/*.sql))
 REGRESS = test-normalize_address test-upgrade
 REGRESS_OPTS = --load-extension=fuzzystrmatch --load-extension=postgis --load-extension=$(EXTENSION)
 
-PG_CONFIG    =  /var/lib/jenkins/workspace/pg/rel/pg9.5w64/bin/pg_config
+PG_CONFIG    =  /var/lib/jenkins/workspace/pg/rel/pg9.6w64/bin/pg_config
 
 PG91         = $(shell $(PG_CONFIG) --version | $(GREP) -qE " 8\.| 9\.0" && echo no || echo yes)
 SQL_BITS     = $(wildcard sql_bits/*.sql)
diff --git a/extensions/postgis_tiger_geocoder/postgis_tiger_geocoder.control b/extensions/postgis_tiger_geocoder/postgis_tiger_geocoder.control
index be20ac7..15da133 100644
--- a/extensions/postgis_tiger_geocoder/postgis_tiger_geocoder.control
+++ b/extensions/postgis_tiger_geocoder/postgis_tiger_geocoder.control
@@ -1,6 +1,6 @@
 # postgis tiger geocoder extension
 comment = 'PostGIS tiger geocoder and reverse geocoder'
-default_version = '2.3.0'
+default_version = '2.3.1'
 relocatable = false
 schema = tiger
 requires = 'postgis,fuzzystrmatch'
diff --git a/extensions/postgis_topology/Makefile b/extensions/postgis_topology/Makefile
index 99e1247..5e99b96 100644
--- a/extensions/postgis_topology/Makefile
+++ b/extensions/postgis_topology/Makefile
@@ -1,7 +1,7 @@
 include ../upgradeable_versions.mk
 
 EXTENSION     = postgis_topology
-EXTVERSION    = 2.3.0
+EXTVERSION    = 2.3.1
 MINORVERSION  = 2.3
 GREP = /bin/grep
 PERL = /usr/bin/perl
@@ -21,7 +21,7 @@ PREREL_PREFIX = $(shell echo $(EXTVERSION) | \
 
 DATA         = $(filter-out $(wildcard sql/*--*.sql),$(wildcard sql/*.sql))
 
-PG_CONFIG    = /var/lib/jenkins/workspace/pg/rel/pg9.5w64/bin/pg_config
+PG_CONFIG    = /var/lib/jenkins/workspace/pg/rel/pg9.6w64/bin/pg_config
 
 PG91         = $(shell $(PG_CONFIG) --version | $(GREP) -qE " 8\.| 9\.0" && echo no || echo yes)
 SQL_BITS     = $(wildcard sql_bits/*.sql)
diff --git a/extensions/postgis_topology/postgis_topology.control b/extensions/postgis_topology/postgis_topology.control
index 2c88f5f..04039a2 100644
--- a/extensions/postgis_topology/postgis_topology.control
+++ b/extensions/postgis_topology/postgis_topology.control
@@ -1,6 +1,6 @@
 # postgis topology extension
 comment = 'PostGIS topology spatial types and functions'
-default_version = '2.3.0'
+default_version = '2.3.1'
 relocatable = false
 schema = topology
 requires = postgis
diff --git a/extensions/upgradeable_versions.mk b/extensions/upgradeable_versions.mk
index 55c2577..625b277 100644
--- a/extensions/upgradeable_versions.mk
+++ b/extensions/upgradeable_versions.mk
@@ -21,7 +21,8 @@ UPGRADEABLE_VERSIONS = \
 	2.2.1 \
 	2.2.2 \
 	2.2.3 \
-	2.3.0rc1
+	2.2.4 \
+	2.3.0
 
 # This is to avoid forcing "check-installed-upgrades" as a default
 # rule, see https://trac.osgeo.org/postgis/ticket/3420
diff --git a/liblwgeom/lwgeodetic.c b/liblwgeom/lwgeodetic.c
index cc17734..b48a908 100644
--- a/liblwgeom/lwgeodetic.c
+++ b/liblwgeom/lwgeodetic.c
@@ -949,6 +949,8 @@ double sphere_direction(const GEOGRAPHIC_POINT *s, const GEOGRAPHIC_POINT *e, do
 	f = (sin(e->lat) - sin(s->lat) * cos(d)) / (sin(d) * cos(s->lat));
 	if ( FP_EQUALS(f, 1.0) )
 		heading = 0.0;
+	else if ( FP_EQUALS(f, -1.0) )
+		heading = M_PI;
 	else if ( fabs(f) > 1.0 )
 	{
 		LWDEBUGF(4, "f = %g", f);
diff --git a/liblwgeom/lwgeom_geos.c b/liblwgeom/lwgeom_geos.c
index 3e44fc3..c635ee7 100644
--- a/liblwgeom/lwgeom_geos.c
+++ b/liblwgeom/lwgeom_geos.c
@@ -1047,7 +1047,7 @@ lwgeom_clip_by_rect(const LWGEOM *geom1, double x0, double y0, double x1, double
 #if POSTGIS_GEOS_VERSION < 35
 	lwerror("The GEOS version this postgis binary "
 	        "was compiled against (%d) doesn't support "
-	        "'GEOSClipByRect' function (3.3.5+ required)",
+	        "'GEOSClipByRect' function (3.5.0+ required)",
 	        POSTGIS_GEOS_VERSION);
 	return NULL;
 #else /* POSTGIS_GEOS_VERSION >= 35 */
diff --git a/liblwgeom/lwstroke.c b/liblwgeom/lwstroke.c
index 924322b..a6af62c 100644
--- a/liblwgeom/lwstroke.c
+++ b/liblwgeom/lwstroke.c
@@ -442,6 +442,8 @@ lwcollection_stroke(const LWCOLLECTION *collection, uint32_t perQuad)
 		case CURVEPOLYTYPE:
 			geoms[i] = (LWGEOM *)lwcurvepoly_stroke((LWCURVEPOLY *)tmp, perQuad);
 			break;
+		case MULTICURVETYPE:
+		case MULTISURFACETYPE:
 		case COLLECTIONTYPE:
 			geoms[i] = (LWGEOM *)lwcollection_stroke((LWCOLLECTION *)tmp, perQuad);
 			break;
diff --git a/libpgcommon/gserialized_gist.c b/libpgcommon/gserialized_gist.c
index 4a8d8c9..d379fb2 100644
--- a/libpgcommon/gserialized_gist.c
+++ b/libpgcommon/gserialized_gist.c
@@ -290,12 +290,17 @@ gserialized_datum_get_gidx_p(Datum gsdatum, GIDX *gidx)
 		{
 			POSTGIS_DEBUG(4, "could not calculate bbox, returning failure");
 			lwgeom_free(lwgeom);
+			POSTGIS_FREE_IF_COPY_P(gpart, gsdatum);
+			POSTGIS_FREE_IF_COPY_P(g, gsdatum);
 			return LW_FAILURE;
 		}
 		lwgeom_free(lwgeom);
+		POSTGIS_FREE_IF_COPY_P(g, gsdatum);
 		result = gidx_from_gbox_p(gbox, gidx);
 	}
-	
+
+	POSTGIS_FREE_IF_COPY_P(gpart, gsdatum);
+
 	if ( result == LW_SUCCESS )
 	{
 		POSTGIS_DEBUGF(4, "got gidx %s", gidx_to_string(gidx));
diff --git a/libpgcommon/gserialized_gist.h b/libpgcommon/gserialized_gist.h
index b6a3c49..292bb1e 100644
--- a/libpgcommon/gserialized_gist.h
+++ b/libpgcommon/gserialized_gist.h
@@ -27,6 +27,17 @@ typedef struct
 #define GIDX_MAX_DIM 4
 
 
+/*
+ * This macro is based on PG_FREE_IF_COPY, except that it accepts two pointers.
+ * See PG_FREE_IF_COPY comment in src/include/fmgr.h in postgres source code
+ * for more details.
+ */
+#define POSTGIS_FREE_IF_COPY_P(ptrsrc, ptrori) \
+	do { \
+		if ((Pointer) (ptrsrc) != (Pointer) (ptrori)) \
+			pfree(ptrsrc); \
+	} while (0)
+
 /**********************************************************************
 **  BOX2DF structure.
 **
@@ -95,6 +106,8 @@ GSERIALIZED* gserialized_set_gidx(GSERIALIZED *g, GIDX *gidx);
 /* Remove the box from a disk serialization */
 GSERIALIZED* gserialized_drop_gidx(GSERIALIZED *g);
 
+bool box2df_contains(const BOX2DF *a, const BOX2DF *b);
+bool gidx_contains(GIDX *a, GIDX *b);
 int gserialized_datum_get_box2df_p(Datum gsdatum, BOX2DF *box2df);
 
 
diff --git a/postgis/brin_2d.c b/postgis/brin_2d.c
index f5fc2f5..148951d 100644
--- a/postgis/brin_2d.c
+++ b/postgis/brin_2d.c
@@ -72,17 +72,20 @@ geom2d_brin_inclusion_add_value(PG_FUNCTION_ARGS)
 		PG_RETURN_BOOL(true);
 	}
 
+	box_key = (BOX2DF *) column->bv_values[INCLUSION_UNION];
+
+	/* Check if the stored bouding box already contains the geometry's one */
+	if (box2df_contains(box_key, &box_geom))
+			PG_RETURN_BOOL(false);
+
 	/*
 	 * Otherwise, we need to enlarge the stored box2df to make it contains the
 	 * current geometry
 	 */
-	box_key = (BOX2DF *) column->bv_values[INCLUSION_UNION];
-
-	/* enlarge box2df */
 	box_key->xmin = Min(box_key->xmin, box_geom.xmin);
 	box_key->xmax = Max(box_key->xmax, box_geom.xmax);
 	box_key->ymin = Min(box_key->ymin, box_geom.ymin);
 	box_key->ymax = Max(box_key->ymax, box_geom.ymax);
 
-	PG_RETURN_BOOL(false);
+	PG_RETURN_BOOL(true);
 }
diff --git a/postgis/brin_nd.c b/postgis/brin_nd.c
index db8a871..ad1470d 100644
--- a/postgis/brin_nd.c
+++ b/postgis/brin_nd.c
@@ -12,7 +12,7 @@
  */
 
 Datum gidx_brin_inclusion_add_value(BrinDesc *bdesc, BrinValues *column, Datum
-		newval, bool isnull, int dims_wanted);
+		newval, bool isnull, int max_dims);
 
 /*
  * As for the GiST case, geographies are converted into GIDX before
@@ -60,13 +60,13 @@ geom4d_brin_inclusion_add_value(PG_FUNCTION_ARGS)
 
 Datum
 gidx_brin_inclusion_add_value(BrinDesc *bdesc, BrinValues *column, Datum newval,
-		bool isnull, int dims_wanted)
+		bool isnull, int max_dims)
 {
 	char gboxmem[GIDX_MAX_SIZE];
 	GIDX *gidx_geom, *gidx_key;
-	int dims_geom, i;
+	int dims_geom, dims_key, i;
 
-	Assert(dims_wanted <= GIDX_MAX_DIM);
+	Assert(max_dims <= GIDX_MAX_DIM);
 
 	/*
 	 * If the new value is null, we record that we saw it if it's the first
@@ -81,6 +81,14 @@ gidx_brin_inclusion_add_value(BrinDesc *bdesc, BrinValues *column, Datum newval,
 		PG_RETURN_BOOL(true);
 	}
 
+	/*
+	 * No need for further processing if the block range is already initialized
+	 * and is marked as containing unmergeable values.
+	 */
+	if (!column->bv_allnulls &&
+			DatumGetBool(column->bv_values[INCLUSION_UNMERGEABLE]))
+		PG_RETURN_BOOL(false);
+
 	/* create a new GIDX in stack memory, maximum dimensions */
 	gidx_geom = (GIDX *) gboxmem;
 
@@ -120,28 +128,24 @@ gidx_brin_inclusion_add_value(BrinDesc *bdesc, BrinValues *column, Datum newval,
 	if (column->bv_allnulls)
 	{
 		/*
-		 * We have to make sure we store a GIDX of wanted dimension. If the
-		 * original geometry has less dimensions, we zero them in the GIDX. If
-		 * the original geometry has more, we ignore them.
+		 * It's not safe to summarize geometries of different number of
+		 * dimensions in the same range.  We therefore fix the number of
+		 * dimension for this range by storing the bounding box of the first
+		 * geometry found as is, being careful not to store more dimension than
+		 * defined in the opclass.
 		 */
-		if (dims_geom != dims_wanted)
+		if (dims_geom > max_dims)
 		{
 			/*
-			 * This is safe to either enlarge or diminush the varsize because
-			 * the GIDX was created with the maximum number of dimension a GIDX
-			 * can contain
+			 * Diminush the varsize to only store the maximum number of
+			 * dimensions allowed by the opclass
 			 */
-			SET_VARSIZE(gidx_geom, VARHDRSZ + dims_wanted * 2 * sizeof(float));
-		}
-		/* zero the extra dimensions if we enlarged the GIDX */
-		for (i = dims_geom; i < dims_wanted; i++)
-		{
-			GIDX_SET_MIN(gidx_geom, i, 0);
-			GIDX_SET_MAX(gidx_geom, i, 0);
+			SET_VARSIZE(gidx_geom, VARHDRSZ + max_dims * 2 * sizeof(float));
+			dims_geom = max_dims;
 		}
 
 		column->bv_values[INCLUSION_UNION] = datumCopy((Datum) gidx_geom, false,
-				GIDX_SIZE(dims_wanted));
+				GIDX_SIZE(dims_geom));
 		column->bv_values[INCLUSION_UNMERGEABLE] = BoolGetDatum(false);
 		column->bv_values[INCLUSION_CONTAINS_EMPTY] = BoolGetDatum(false);
 		column->bv_allnulls = false;
@@ -149,12 +153,28 @@ gidx_brin_inclusion_add_value(BrinDesc *bdesc, BrinValues *column, Datum newval,
 	}
 
 	gidx_key = (GIDX *) column->bv_values[INCLUSION_UNION];
+	dims_key = GIDX_NDIMS(gidx_key);
+
+	/*
+	 * Mark the datum as unmergeable if its number of dimension is not the same
+	 * as the one stored in the key of the current range
+	 */
+	if (dims_key != dims_geom)
+	{
+		column->bv_values[INCLUSION_UNMERGEABLE] = BoolGetDatum(true);
+		PG_RETURN_BOOL(true);
+	}
+
+	/* Check if the stored bounding box already contains the geometry's one */
+	if (gidx_contains(gidx_key, gidx_geom))
+			PG_RETURN_BOOL(false);
 
 	/*
-	 * As we always store a GIDX of the wanted number of dimensions, we just
-	 * need adjust min and max
+	 * Otherwise, we need to enlarge the stored GIDX to make it contains the
+	 * current geometry.  As we store a GIDX with a fixed number of dimensions,
+	 * we just need adjust min and max
 	 */
-	for ( i = 0; i < dims_wanted; i++ )
+	for ( i = 0; i < dims_key; i++ )
 	{
 		/* Adjust minimums */
 		GIDX_SET_MIN(gidx_key, i,
@@ -164,5 +184,5 @@ gidx_brin_inclusion_add_value(BrinDesc *bdesc, BrinValues *column, Datum newval,
 				Max(GIDX_GET_MAX(gidx_key,i),GIDX_GET_MAX(gidx_geom,i)));
 	}
 
-	PG_RETURN_BOOL(false);
+	PG_RETURN_BOOL(true);
 }
diff --git a/postgis/gserialized_gist_2d.c b/postgis/gserialized_gist_2d.c
index 70ba6d0..6c38249 100644
--- a/postgis/gserialized_gist_2d.c
+++ b/postgis/gserialized_gist_2d.c
@@ -291,7 +291,7 @@ static bool box2df_overlaps(const BOX2DF *a, const BOX2DF *b)
 	return TRUE;
 }
 
-static bool box2df_contains(const BOX2DF *a, const BOX2DF *b)
+bool box2df_contains(const BOX2DF *a, const BOX2DF *b)
 {
 	if ( ! a || ! b ) return FALSE; /* TODO: might be smarter for EMPTY */
 
@@ -595,11 +595,16 @@ gserialized_datum_get_box2df_p(Datum gsdatum, BOX2DF *box2df)
 		if (gserialized_get_gbox_p(g, &gbox) == LW_FAILURE)
 		{
 			POSTGIS_DEBUG(4, "could not calculate bbox, returning failure");
+			POSTGIS_FREE_IF_COPY_P(gpart, gsdatum);
+			POSTGIS_FREE_IF_COPY_P(g, gsdatum);
 			return LW_FAILURE;
 		}
+		POSTGIS_FREE_IF_COPY_P(g, gsdatum);
 		result = box2df_from_gbox_p(&gbox, box2df);
 	}
 
+	POSTGIS_FREE_IF_COPY_P(gpart, gsdatum);
+
 	if ( result == LW_SUCCESS )
 	{
 		POSTGIS_DEBUGF(4, "got box2df %s", box2df_to_string(box2df));
diff --git a/postgis/gserialized_gist_nd.c b/postgis/gserialized_gist_nd.c
index 9be47be..4fc5fa4 100644
--- a/postgis/gserialized_gist_nd.c
+++ b/postgis/gserialized_gist_nd.c
@@ -378,7 +378,7 @@ static bool gidx_overlaps(GIDX *a, GIDX *b)
 **
 ** Box(A) CONTAINS Box(B) IFF (pt(A)LL < pt(B)LL) && (pt(A)UR > pt(B)UR)
 */
-static bool gidx_contains(GIDX *a, GIDX *b)
+bool gidx_contains(GIDX *a, GIDX *b)
 {
 	int i, dims_a, dims_b;
 
diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in
index 57c9907..3df912e 100644
--- a/postgis/postgis.sql.in
+++ b/postgis/postgis.sql.in
@@ -3742,23 +3742,29 @@ CREATE OR REPLACE FUNCTION ST_Combine_BBox(box2d,geometry)
 
 
 -- Availability: 1.2.2
-CREATE AGGREGATE ST_Extent(
+-- Changed: 2.2.0 to use non-deprecated ST_CombineBBox (r13535)
+-- Changed: 2.3.0 to support PostgreSQL 9.6
+-- Changed: 2.3.1 to support PostgreSQL 9.6 parallel safe
+CREATE AGGREGATE ST_Extent(geometry) (
 	sfunc = ST_CombineBBox,
+  stype = box3d,
 #if POSTGIS_PGSQL_VERSION >= 96
-  combinefunc = ST_CombineBBox,
+	combinefunc = ST_CombineBBox,
+	parallel = safe,
 #endif
-	finalfunc = box2d,
-	basetype = geometry,
-	stype = box3d
+	finalfunc = box2d
 	);
 
 -- Availability: 2.0.0
-CREATE AGGREGATE ST_3DExtent(
+-- Changed: 2.2.0 to use non-deprecated ST_CombineBBox (r13535)
+-- Changed: 2.3.0 to support PostgreSQL 9.6
+-- Changed: 2.3.1 to support PostgreSQL 9.6 parallel safe
+CREATE AGGREGATE ST_3DExtent(geometry)(
 	sfunc = ST_CombineBBox,
 #if POSTGIS_PGSQL_VERSION >= 96
-  combinefunc = ST_CombineBBox,
+	combinefunc = ST_CombineBBox,
+	parallel = safe,
 #endif
-	basetype = geometry,
 	stype = box3d
 	);
 
@@ -3769,12 +3775,14 @@ CREATE OR REPLACE FUNCTION ST_Collect(geom1 geometry, geom2 geometry)
 	LANGUAGE 'c' IMMUTABLE  _PARALLEL;
 
 -- Availability: 1.2.2
-CREATE AGGREGATE ST_MemCollect(
+-- Changed: 2.3.0 to support PostgreSQL 9.6
+-- Changed: 2.3.1 to support PostgreSQL 9.6 parallel safe
+CREATE AGGREGATE ST_MemCollect(geometry)(
 	sfunc = ST_collect,
 #if POSTGIS_PGSQL_VERSION >= 96
-  combinefunc = ST_collect,
+	combinefunc = ST_collect,
+	parallel = safe,
 #endif
-	basetype = geometry,
 	stype = geometry
 	);
 
@@ -3785,11 +3793,13 @@ CREATE OR REPLACE FUNCTION ST_Collect(geometry[])
 	LANGUAGE 'c' IMMUTABLE STRICT  _PARALLEL;
 
 -- Availability: 1.2.2
-CREATE AGGREGATE ST_MemUnion (
-	basetype = geometry,
+-- Changed: 2.3.0 to support PostgreSQL 9.6
+-- Changed: 2.3.1 to support PostgreSQL 9.6 parallel safe
+CREATE AGGREGATE ST_MemUnion(geometry) (
 	sfunc = ST_Union,
 #if POSTGIS_PGSQL_VERSION >= 96
-  combinefunc = ST_Union,
+	combinefunc = ST_Union,
+	parallel = safe,
 #endif
 	stype = geometry
 	);
@@ -5875,7 +5885,7 @@ $$
 	cavept geometry[];
 	seglength double precision;
 	var_tempgeom geometry;
-	scale_factor integer := 1;
+	scale_factor float := 1;
 	i integer;
 
 	BEGIN
diff --git a/postgis/postgis_module.c b/postgis/postgis_module.c
index 7f2e351..e107098 100644
--- a/postgis/postgis_module.c
+++ b/postgis/postgis_module.c
@@ -127,7 +127,12 @@ _PG_fini(void)
 static void
 handleInterrupt(int sig)
 {
-  printf("Interrupt requested\n"); fflush(stdout);
+  /* NOTE: printf here would be dangerous, see
+   * https://trac.osgeo.org/postgis/ticket/3644
+   *
+   * TODO: block interrupts during execution, to fix the problem
+   */
+  /* printf("Interrupt requested\n"); fflush(stdout); */
 
 #if POSTGIS_GEOS_VERSION >= 34
   GEOS_interruptRequest();
diff --git a/postgis/sqldefines.h b/postgis/sqldefines.h
index ff224ba..c0d2834 100644
--- a/postgis/sqldefines.h
+++ b/postgis/sqldefines.h
@@ -6,10 +6,10 @@
 /*
  * Define just the version numbers; otherwise we get some strange substitutions in postgis.sql.in
  */
-#define POSTGIS_PGSQL_VERSION 95
-#define POSTGIS_GEOS_VERSION 35
+#define POSTGIS_PGSQL_VERSION 96
+#define POSTGIS_GEOS_VERSION 36
 #define POSTGIS_PROJ_VERSION 49
-#define POSTGIS_LIB_VERSION '2.3.0'
+#define POSTGIS_LIB_VERSION '2.3.1'
 #define POSTGIS_LIBXML2_VERSION 2.9.4
 #define POSTGIS_SFCGAL_VERSION 13
 
@@ -25,12 +25,12 @@
  * won't substitute within apostrophes)
  */
 #define _POSTGIS_SQL_SELECT_POSTGIS_VERSION 'SELECT ''2.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1''::text AS version'
-#define _POSTGIS_SQL_SELECT_POSTGIS_BUILD_DATE 'SELECT ''2016-09-26 13:11:37''::text AS version'
+#define _POSTGIS_SQL_SELECT_POSTGIS_BUILD_DATE 'SELECT ''2016-11-28 15:14:03''::text AS version'
 
 #if POSTGIS_SVN_REVISION
-#define _POSTGIS_SQL_SELECT_POSTGIS_SCRIPTS_VERSION $$ SELECT '2.3.0'::text || ' r' || POSTGIS_SVN_REVISION::text AS version $$
+#define _POSTGIS_SQL_SELECT_POSTGIS_SCRIPTS_VERSION $$ SELECT '2.3.1'::text || ' r' || POSTGIS_SVN_REVISION::text AS version $$
 #else
-#define _POSTGIS_SQL_SELECT_POSTGIS_SCRIPTS_VERSION $$ SELECT '2.3.0'::text AS version $$
+#define _POSTGIS_SQL_SELECT_POSTGIS_SCRIPTS_VERSION $$ SELECT '2.3.1'::text AS version $$
 #endif
 
 #define SRID_USR_MAX 998999
diff --git a/postgis_svn_revision.h b/postgis_svn_revision.h
index 691dee5..747ef71 100644
--- a/postgis_svn_revision.h
+++ b/postgis_svn_revision.h
@@ -1 +1 @@
-#define POSTGIS_SVN_REVISION 15146
+#define POSTGIS_SVN_REVISION 15264
diff --git a/raster/rt_pg/rtpostgis.c b/raster/rt_pg/rtpostgis.c
index 1ae9879..215fa6e 100644
--- a/raster/rt_pg/rtpostgis.c
+++ b/raster/rt_pg/rtpostgis.c
@@ -132,6 +132,7 @@
 #include <postgres.h> /* for palloc */
 #include <fmgr.h> /* for PG_MODULE_MAGIC */
 #include "utils/guc.h"
+#include "utils/memutils.h"
 
 #include "../../postgis_config.h"
 #include "lwgeom_pg.h"
@@ -151,6 +152,9 @@ PG_MODULE_MAGIC;
 /* Module load callback */
 void _PG_init(void);
 
+/* Module unload callback */
+void _PG_fini(void);
+
 #define RT_MSG_MAXLEN 256
 
 
@@ -244,6 +248,14 @@ static char *gdal_datapath = NULL;
 extern char *gdal_enabled_drivers;
 extern char enable_outdb_rasters;
 
+/* ---------------------------------------------------------------- */
+/*  Useful variables                                                */
+/* ---------------------------------------------------------------- */
+
+static char *env_postgis_gdal_enabled_drivers = NULL;
+static char *boot_postgis_gdal_enabled_drivers = NULL;
+static char *env_postgis_enable_outdb_rasters = NULL;
+
 /* postgis.gdal_datapath */
 static void
 rtpg_assignHookGDALDataPath(const char *newpath, void *extra) {
@@ -408,11 +420,14 @@ rtpg_assignHookEnableOutDBRasters(bool enable, void *extra) {
 void
 _PG_init(void) {
 
-	char *env_postgis_gdal_enabled_drivers = NULL;
-	char *boot_postgis_gdal_enabled_drivers = NULL;
-
-	char *env_postgis_enable_outdb_rasters = NULL;
 	bool boot_postgis_enable_outdb_rasters = false;
+	MemoryContext old_context;
+
+	/*
+	 * Change to context for memory allocation calls like palloc() in the
+	 * extension initialization routine
+	 */
+	old_context = MemoryContextSwitchTo(TopMemoryContext);
 
 	/*
 	 use POSTGIS_GDAL_ENABLED_DRIVERS to set the bootValue
@@ -543,8 +558,29 @@ _PG_init(void) {
 		);
 	}
 
-	/* free memory allocations */
+	/* Revert back to old context */
+	MemoryContextSwitchTo(old_context);
+}
+
+/* Module unload callback */
+void
+_PG_fini(void) {
+
+	MemoryContext old_context;
+
+	old_context = MemoryContextSwitchTo(TopMemoryContext);
+
+	/* Clean up */
+	pfree(env_postgis_gdal_enabled_drivers);
 	pfree(boot_postgis_gdal_enabled_drivers);
+	pfree(env_postgis_enable_outdb_rasters);
+
+	env_postgis_gdal_enabled_drivers = NULL;
+	boot_postgis_gdal_enabled_drivers = NULL;
+	env_postgis_enable_outdb_rasters = NULL;
+
+	/* Revert back to old context */
+	MemoryContextSwitchTo(old_context);
 }
 
 
diff --git a/raster/rt_pg/rtpostgis.sql.in b/raster/rt_pg/rtpostgis.sql.in
index a50c2bd..b2f3d6b 100644
--- a/raster/rt_pg/rtpostgis.sql.in
+++ b/raster/rt_pg/rtpostgis.sql.in
@@ -7138,7 +7138,7 @@ CREATE OR REPLACE FUNCTION _add_raster_constraint_extent(rastschema name, rastta
 		fqtn text;
 		cn name;
 		sql text;
-		attr text;
+		attr text; srid integer;
 	BEGIN
 		fqtn := '';
 		IF length($1) > 0 THEN
@@ -7146,23 +7146,37 @@ CREATE OR REPLACE FUNCTION _add_raster_constraint_extent(rastschema name, rastta
 		END IF;
 		fqtn := fqtn || quote_ident($2);
 
+		sql := 'SELECT MAX(@extschema at .ST_SRID('
+            || quote_ident($3)
+      || ') ) FROM '
+            || fqtn
+            || ' HAVING COUNT(DISTINCT @extschema at .ST_SRID('
+            || quote_ident($3)
+      || ') ) = 1';
+    EXECUTE sql INTO srid;
+    
 		cn := 'enforce_max_extent_' || $3;
 
-		sql := 'SELECT @extschema at .st_ashexewkb( @extschema at .st_envelope( @extschema at .st_union( @extschema at .st_envelope('
-			|| quote_ident($3)
-			|| ')))) FROM '
-			|| fqtn;
-		EXECUTE sql INTO attr;
-
-		sql := 'ALTER TABLE ' || fqtn
-			|| ' ADD CONSTRAINT ' || quote_ident(cn)
-			|| ' CHECK ( @extschema at .st_envelope('
-			|| quote_ident($3)
-			|| ') @ ''' || attr || '''::geometry)';
-		RETURN  @extschema at ._add_raster_constraint(cn, sql);
+		IF srid > -1 THEN
+      sql := 'SELECT @extschema at .st_ashexewkb( @extschema at .st_setsrid( @extschema at .st_extent( @extschema at .st_envelope('
+        || quote_ident($3)
+        || ')), ' || srid || ')) FROM '
+        || fqtn;
+      EXECUTE sql INTO attr;
+  
+      sql := 'ALTER TABLE ' || fqtn
+        || ' ADD CONSTRAINT ' || quote_ident(cn)
+        || ' CHECK ( @extschema at .st_envelope('
+        || quote_ident($3)
+        || ') @ ''' || attr || '''::geometry) ';
+      RETURN  @extschema at ._add_raster_constraint(cn, sql);
+    ELSE 
+      -- no valid srid therefore doesn't make sense to set extent
+      RETURN false;
+    END IF;
 	END;
 	$$ LANGUAGE 'plpgsql' VOLATILE STRICT
-	COST 100;
+	COST 9000;
 
 CREATE OR REPLACE FUNCTION _drop_raster_constraint_extent(rastschema name, rasttable name, rastcolumn name)
 	RETURNS boolean AS
diff --git a/regress/geography.sql b/regress/geography.sql
index f79b223..fc03584 100644
--- a/regress/geography.sql
+++ b/regress/geography.sql
@@ -117,6 +117,10 @@ SELECT 'segmentize_geography', max(st_distance(d1.geom::geography, d2.geom::geog
 -- Check that st_segmentize creates segments on the geodesic path
 SELECT 'segmentize_geography2', st_dwithin(st_pointn(st_segmentize('linestring(1 47,-64 47)'::geography, 3000000)::geometry, 2), 'SRID=4326;POINT(-31.5 51.81)'::geometry, 0.01);
 
+-- #bug 3667
+SELECT 'segmentize_geography_3667', abs(ST_Length(geog) - ST_Length(ST_Segmentize(geog, 30000))) < 0.00001
+  FROM (SELECT ST_GeographyFromText('LINESTRING(38.769917 10.780694, 38.769917 9.106194)') As geog) AS f;
+
 -- Clean up spatial_ref_sys
 DELETE FROM spatial_ref_sys WHERE srid IN (4269,4326);
 
diff --git a/regress/geography_expected b/regress/geography_expected
index db6e8a4..cdbb99a 100644
--- a/regress/geography_expected
+++ b/regress/geography_expected
@@ -29,3 +29,4 @@ geog_precision_pazafir|0|0
 #2422|1|1068|f|f|1400.230|1396.816|1400.230|1400.230
 segmentize_geography|49789
 segmentize_geography2|t
+segmentize_geography_3667|t
diff --git a/regress/regress_brin_index.sql b/regress/regress_brin_index.sql
index 089523c..e0aaf56 100644
--- a/regress/regress_brin_index.sql
+++ b/regress/regress_brin_index.sql
@@ -1,7 +1,7 @@
 --- build a larger database
 \i regress_lots_of_points.sql
 
---- test some of the searching capabilities
+--- Test the various BRIN opclass with dataset containing 2D geometries
 
 CREATE OR REPLACE FUNCTION qnodes(q text) RETURNS text
 LANGUAGE 'plpgsql' AS
@@ -96,6 +96,81 @@ SELECT 'scan_idx', qnodes('select * from test where the_geom &&& ST_MakePoint(0,
 
 DROP INDEX brin_4d;
 
+-- test adding rows and unsummarized ranges
+--
+
+-- 2D
+TRUNCATE TABLE test;
+INSERT INTO test select 1, st_makepoint(1, 1);
+CREATE INDEX brin_2d on test using brin (the_geom) WITH (pages_per_range = 1);
+INSERT INTO test select i, st_makepoint(i, i) FROM generate_series(2, 3) i;
+
+set enable_indexscan = off;
+set enable_bitmapscan = on;
+set enable_seqscan = off;
+
+SELECT 'scan_idx', qnodes('select count(*) from test where the_geom && ''BOX(2.1 2.1, 3.1 3.1)''::box2d');
+ select '2d', count(*) from test where the_geom && 'BOX(2.1 2.1, 3.1 3.1)'::box2d;
+
+INSERT INTO test select i, st_makepoint(i, i) FROM generate_series(4, 1000) i;
+SELECT 'scan_idx', qnodes('select count(*) from test where the_geom && ''BOX(900.1 900.1, 920.1 920.1)''::box2d');
+ select '2d', count(*) from test where the_geom && 'BOX(900.1 900.1, 920.1 920.1)'::box2d;
+
+SELECT 'summarize 2d', brin_summarize_new_values('brin_2d');
+
+SELECT 'scan_idx', qnodes('select count(*) from test where the_geom && ''BOX(900.1 900.1, 920.1 920.1)''::box2d');
+ select '2d', count(*) from test where the_geom && 'BOX(900.1 900.1, 920.1 920.1)'::box2d;
+
+DROP INDEX brin_2d;
+
+-- 3D
+TRUNCATE TABLE test;
+INSERT INTO test select 1, st_makepoint(1, 1);
+CREATE INDEX brin_3d on test using brin (the_geom brin_geometry_inclusion_ops_3d) WITH (pages_per_range = 1);
+INSERT INTO test select i, st_makepoint(i, i) FROM generate_series(2, 3) i;
+
+set enable_indexscan = off;
+set enable_bitmapscan = on;
+set enable_seqscan = off;
+
+SELECT 'scan_idx', qnodes('select count(*) from test where the_geom &&& ''BOX3D(2.1 2.1 2.1, 3.1 3.1 3.1)''::box3d');
+ select '3d', count(*) from test where the_geom &&& 'BOX3D(2.1 2.1 2.1, 3.1 3.1 3.1)'::box3d;
+
+INSERT INTO test select i, st_makepoint(i, i) FROM generate_series(4, 1000) i;
+SELECT 'scan_idx', qnodes('select count(*) from test where the_geom &&& ''BOX3D(900.1 900.1 900.1, 920.1 920.1 920.1)''::box3d');
+ select '3d', count(*) from test where the_geom &&& 'BOX3D(900.1 900.1 900.1, 920.1 920.1 920.1)'::box3d;
+
+SELECT 'summarize 3d', brin_summarize_new_values('brin_3d');
+
+SELECT 'scan_idx', qnodes('select count(*) from test where the_geom &&& ''BOX3D(900.1 900.1 900.1, 920.1 920.1 920.1)''::box3d');
+ select '3d', count(*) from test where the_geom &&& 'BOX3D(900.1 900.1 900.1, 920.1 920.1 920.1)'::box3d;
+
+DROP INDEX brin_3d;
+
+-- 4D
+TRUNCATE TABLE test;
+INSERT INTO test select 1, st_makepoint(1, 1);
+CREATE INDEX brin_4d on test using brin (the_geom brin_geometry_inclusion_ops_4d) WITH (pages_per_range = 1);
+INSERT INTO test select i, st_makepoint(i, i) FROM generate_series(2, 3) i;
+
+set enable_indexscan = off;
+set enable_bitmapscan = on;
+set enable_seqscan = off;
+
+SELECT 'scan_idx', qnodes('select count(*) from test where the_geom &&& ''BOX3D(2.1 2.1 2.1, 3.1 3.1 3.1)''::box3d');
+ select '4d', count(*) from test where the_geom &&& 'BOX3D(2.1 2.1 2.1, 3.1 3.1 3.1)'::box3d;
+
+INSERT INTO test select i, st_makepoint(i, i) FROM generate_series(4, 1000) i;
+SELECT 'scan_idx', qnodes('select count(*) from test where the_geom &&& ''BOX3D(900.1 900.1 900.1, 920.1 920.1 920.1)''::box3d');
+ select '4d', count(*) from test where the_geom &&& 'BOX3D(900.1 900.1 900.1, 920.1 920.1 920.1)'::box3d;
+
+SELECT 'summarize 4d', brin_summarize_new_values('brin_4d');
+
+SELECT 'scan_idx', qnodes('select count(*) from test where the_geom &&& ''BOX3D(900.1 900.1 900.1, 920.1 920.1 920.1)''::box3d');
+ select '4d', count(*) from test where the_geom &&& 'BOX3D(900.1 900.1 900.1, 920.1 920.1 920.1)'::box3d;
+
+DROP INDEX brin_4d;
+
 -- cleanup
 DROP TABLE test;
 DROP FUNCTION qnodes(text);
diff --git a/regress/regress_brin_index_3d.sql b/regress/regress_brin_index_3d.sql
index 07c50da..4fef2a0 100644
--- a/regress/regress_brin_index_3d.sql
+++ b/regress/regress_brin_index_3d.sql
@@ -1,7 +1,8 @@
 --- build a larger database
 \i regress_lots_of_3dpoints.sql
 
---- test some of the searching capabilities
+--- Test the various BRIN opclass with dataset containing 3D geometries, or
+-- geometries of different number of dimensions
 
 CREATE OR REPLACE FUNCTION qnodes(q text) RETURNS text
 LANGUAGE 'plpgsql' AS
@@ -114,6 +115,137 @@ SELECT 'scan_idx', qnodes('SELECT * FROM test WHERE the_geom IS NULL');
 
 DROP INDEX brin_4d;
 
+-- test adding rows and unsummarized ranges
+--
+
+-- 2D
+TRUNCATE TABLE test;
+INSERT INTO test select 1, st_makepoint(1, 1, 1);
+CREATE INDEX brin_2d on test using brin (the_geom) WITH (pages_per_range = 1);
+INSERT INTO test select i, st_makepoint(i, i, i) FROM generate_series(2, 3) i;
+
+set enable_indexscan = off;
+set enable_bitmapscan = on;
+set enable_seqscan = off;
+
+SELECT 'scan_idx', qnodes('select count(*) from test where the_geom && ''BOX(2.1 2.1, 3.1 3.1)''::box2d');
+ select '2d', count(*) from test where the_geom && 'BOX(2.1 2.1, 3.1 3.1)'::box2d;
+
+INSERT INTO test select i, st_makepoint(i, i) FROM generate_series(4, 1000) i;
+SELECT 'scan_idx', qnodes('select count(*) from test where the_geom && ''BOX(900.1 900.1, 920.1 920.1)''::box2d');
+ select '2d', count(*) from test where the_geom && 'BOX(900.1 900.1, 920.1 920.1)'::box2d;
+
+SELECT 'summarize 2d', brin_summarize_new_values('brin_2d');
+
+SELECT 'scan_idx', qnodes('select count(*) from test where the_geom && ''BOX(900.1 900.1, 920.1 920.1)''::box2d');
+ select '2d', count(*) from test where the_geom && 'BOX(900.1 900.1, 920.1 920.1)'::box2d;
+
+DROP INDEX brin_2d;
+
+-- 3D
+TRUNCATE TABLE test;
+INSERT INTO test select 1, st_makepoint(1, 1, 1);
+CREATE INDEX brin_3d on test using brin (the_geom brin_geometry_inclusion_ops_3d) WITH (pages_per_range = 1);
+INSERT INTO test select i, st_makepoint(i, i, i) FROM generate_series(2, 3) i;
+
+set enable_indexscan = off;
+set enable_bitmapscan = on;
+set enable_seqscan = off;
+
+SELECT 'scan_idx', qnodes('select count(*) from test where the_geom &&& ''BOX3D(2.1 2.1 2.1, 3.1 3.1 3.1)''::box3d');
+ select '3d', count(*) from test where the_geom &&& 'BOX3D(2.1 2.1 2.1, 3.1 3.1 3.1)'::box3d;
+
+INSERT INTO test select i, st_makepoint(i, i) FROM generate_series(4, 1000) i;
+SELECT 'scan_idx', qnodes('select count(*) from test where the_geom &&& ''BOX3D(900.1 900.1 900.1, 920.1 920.1 920.1)''::box3d');
+ select '3d', count(*) from test where the_geom &&& 'BOX3D(900.1 900.1 900.1, 920.1 920.1 920.1)'::box3d;
+
+SELECT 'summarize 3d', brin_summarize_new_values('brin_3d');
+
+SELECT 'scan_idx', qnodes('select count(*) from test where the_geom &&& ''BOX3D(900.1 900.1 900.1, 920.1 920.1 920.1)''::box3d');
+ select '3d', count(*) from test where the_geom &&& 'BOX3D(900.1 900.1 900.1, 920.1 920.1 920.1)'::box3d;
+
+DROP INDEX brin_3d;
+
+-- 4D
+TRUNCATE TABLE test;
+INSERT INTO test select 1, st_makepoint(1, 1, 1);
+CREATE INDEX brin_4d on test using brin (the_geom brin_geometry_inclusion_ops_4d) WITH (pages_per_range = 1);
+INSERT INTO test select i, st_makepoint(i, i, i) FROM generate_series(2, 3) i;
+
+set enable_indexscan = off;
+set enable_bitmapscan = on;
+set enable_seqscan = off;
+
+SELECT 'scan_idx', qnodes('select count(*) from test where the_geom &&& ''BOX3D(2.1 2.1 2.1, 3.1 3.1 3.1)''::box3d');
+ select '4d', count(*) from test where the_geom &&& 'BOX3D(2.1 2.1 2.1, 3.1 3.1 3.1)'::box3d;
+
+INSERT INTO test select i, st_makepoint(i, i) FROM generate_series(4, 1000) i;
+SELECT 'scan_idx', qnodes('select count(*) from test where the_geom &&& ''BOX3D(900.1 900.1 900.1, 920.1 920.1 920.1)''::box3d');
+ select '4d', count(*) from test where the_geom &&& 'BOX3D(900.1 900.1 900.1, 920.1 920.1 920.1)'::box3d;
+
+SELECT 'summarize 4d', brin_summarize_new_values('brin_4d');
+
+SELECT 'scan_idx', qnodes('select count(*) from test where the_geom &&& ''BOX3D(900.1 900.1 900.1, 920.1 920.1 920.1)''::box3d');
+ select '4d', count(*) from test where the_geom &&& 'BOX3D(900.1 900.1 900.1, 920.1 920.1 920.1)'::box3d;
+
+DROP INDEX brin_4d;
+
+-- test mix of dimensions, NULL and empty geomertries
+TRUNCATE TABLE test;
+INSERT INTO test SELECT i,
+    CASE i%5
+        WHEN 0 THEN ST_MakePoint(i, i)
+        WHEN 1 THEN ST_MakePoint(i, i, 2)
+        WHEN 2 THEN ST_MakePoint(i, i, 2, 3)
+        WHEN 3 THEN NULL
+        ELSE 'POINTZ EMPTY'::geometry
+    END
+    FROM generate_series(1, 5) i;
+
+-- seq scan
+set enable_indexscan = off;
+set enable_bitmapscan = off;
+set enable_seqscan = on;
+SELECT 'scan_seq', qnodes('select * from test where the_geom && ''BOX(1 1, 5 5)''::box2d');
+ select 'mix_seq_box2d', num,ST_astext(the_geom) from test where the_geom && 'BOX(1 1, 5 5)'::box2d order by num;
+ select 'mix_seq_box3d', num,ST_astext(the_geom) from test where the_geom &&& 'BOX3D(1 1 0, 5 5 0)'::box3d order by num;
+
+-- 2D
+CREATE INDEX brin_2d on test using brin (the_geom) WITH (pages_per_range = 1);
+set enable_indexscan = off;
+set enable_bitmapscan = on;
+set enable_seqscan = off;
+
+SELECT 'scan_idx', qnodes('select * from test where the_geom && ''BOX(1 1, 5 5)''::box2d');
+ select 'mix_2d_box2d', num,ST_astext(the_geom) from test where the_geom && 'BOX(1 1, 5 5)'::box2d order by num;
+ select 'mix_2d_box3d', num,ST_astext(the_geom) from test where the_geom &&& 'BOX3D(1 1 0, 5 5 0)'::box3d order by num;
+
+DROP INDEX brin_2d;
+
+-- 3D
+CREATE INDEX brin_3d on test using brin (the_geom brin_geometry_inclusion_ops_3d);
+set enable_indexscan = off;
+set enable_bitmapscan = on;
+set enable_seqscan = off;
+
+SELECT 'scan_idx', qnodes('select * from test where the_geom && ''BOX(1 1, 5 5)''::box2d');
+ select 'mix_3d_box2d', num,ST_astext(the_geom) from test where the_geom && 'BOX(1 1, 5 5)'::box2d order by num;
+ select 'mix_3d_box3d', num,ST_astext(the_geom) from test where the_geom &&& 'BOX3D(1 1 0, 5 5 0)'::box3d order by num;
+
+DROP INDEX brin_3d;
+
+-- 4D
+CREATE INDEX brin_4d on test using brin (the_geom brin_geometry_inclusion_ops_4d);
+set enable_indexscan = off;
+set enable_bitmapscan = on;
+set enable_seqscan = off;
+
+SELECT 'scan_idx', qnodes('select * from test where the_geom && ''BOX(1 1, 5 5)''::box2d');
+ select 'mix_4d_box2d', num,ST_astext(the_geom) from test where the_geom && 'BOX(1 1, 5 5)'::box2d order by num;
+ select 'mix_4d_box3d', num,ST_astext(the_geom) from test where the_geom &&& 'BOX3D(1 1 0, 5 5 0)'::box3d order by num;
+
+DROP INDEX brin_4d;
+
 -- cleanup
 DROP TABLE test;
 DROP FUNCTION qnodes(text);
diff --git a/regress/regress_brin_index_3d_expected b/regress/regress_brin_index_3d_expected
index 0c05fc6..6cbaf08 100644
--- a/regress/regress_brin_index_3d_expected
+++ b/regress/regress_brin_index_3d_expected
@@ -130,3 +130,44 @@ scan_idx|Bitmap Heap Scan,Bitmap Index Scan
 1260|POINT Z (126 126 126)
 scan_idx|Bitmap Heap Scan,Bitmap Index Scan
 20
+scan_idx|Bitmap Heap Scan,Bitmap Index Scan
+2d|1
+scan_idx|Bitmap Heap Scan,Bitmap Index Scan
+2d|20
+summarize 2d|8
+scan_idx|Bitmap Heap Scan,Bitmap Index Scan
+2d|20
+scan_idx|Bitmap Heap Scan,Bitmap Index Scan
+3d|1
+scan_idx|Bitmap Heap Scan,Bitmap Index Scan
+3d|20
+summarize 3d|8
+scan_idx|Bitmap Heap Scan,Bitmap Index Scan
+3d|20
+scan_idx|Bitmap Heap Scan,Bitmap Index Scan
+4d|1
+scan_idx|Bitmap Heap Scan,Bitmap Index Scan
+4d|20
+summarize 4d|8
+scan_idx|Bitmap Heap Scan,Bitmap Index Scan
+4d|20
+scan_seq|Seq Scan
+mix_seq_box2d|1|POINT Z (1 1 2)
+mix_seq_box2d|2|POINT ZM (2 2 2 3)
+mix_seq_box2d|5|POINT(5 5)
+mix_seq_box3d|5|POINT(5 5)
+scan_idx|Bitmap Heap Scan,Bitmap Index Scan
+mix_2d_box2d|1|POINT Z (1 1 2)
+mix_2d_box2d|2|POINT ZM (2 2 2 3)
+mix_2d_box2d|5|POINT(5 5)
+mix_2d_box3d|5|POINT(5 5)
+scan_idx|Seq Scan
+mix_3d_box2d|1|POINT Z (1 1 2)
+mix_3d_box2d|2|POINT ZM (2 2 2 3)
+mix_3d_box2d|5|POINT(5 5)
+mix_3d_box3d|5|POINT(5 5)
+scan_idx|Seq Scan
+mix_4d_box2d|1|POINT Z (1 1 2)
+mix_4d_box2d|2|POINT ZM (2 2 2 3)
+mix_4d_box2d|5|POINT(5 5)
+mix_4d_box3d|5|POINT(5 5)
diff --git a/regress/regress_brin_index_expected b/regress/regress_brin_index_expected
index 009a0ae..7322b29 100644
--- a/regress/regress_brin_index_expected
+++ b/regress/regress_brin_index_expected
@@ -38,3 +38,24 @@ scan_idx|Bitmap Heap Scan,Bitmap Index Scan
 2594|POINT(130.504303 126.53112)
 3618|POINT(130.447205 131.655289)
 7245|POINT(128.10466 130.94133)
+scan_idx|Bitmap Heap Scan,Bitmap Index Scan
+2d|1
+scan_idx|Bitmap Heap Scan,Bitmap Index Scan
+2d|20
+summarize 2d|8
+scan_idx|Bitmap Heap Scan,Bitmap Index Scan
+2d|20
+scan_idx|Bitmap Heap Scan,Bitmap Index Scan
+3d|1
+scan_idx|Bitmap Heap Scan,Bitmap Index Scan
+3d|20
+summarize 3d|8
+scan_idx|Bitmap Heap Scan,Bitmap Index Scan
+3d|20
+scan_idx|Bitmap Heap Scan,Bitmap Index Scan
+4d|1
+scan_idx|Bitmap Heap Scan,Bitmap Index Scan
+4d|20
+summarize 4d|8
+scan_idx|Bitmap Heap Scan,Bitmap Index Scan
+4d|20
diff --git a/utils/check_all_upgrades.sh b/utils/check_all_upgrades.sh
new file mode 100755
index 0000000..d136336
--- /dev/null
+++ b/utils/check_all_upgrades.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+if test -z "$1"; then
+  echo "Usage: $0 <to_version>" >&2
+  exit 1
+fi
+to_version="$1"
+
+BUILDDIR=$PWD
+EXTDIR=`pg_config --sharedir`/extension/
+
+cd $EXTDIR
+'ls' postgis--* | grep -v -- '--.*--' |
+sed 's/^postgis--\(.*\)\.sql/\1/' | while read fname; do
+  from_version="$fname"
+  UPGRADE_PATH="${from_version}--${to_version}"
+  if test -e postgis--${UPGRADE_PATH}.sql; then
+    echo "Testing upgrade $UPGRADE_PATH"
+    export RUNTESTFLAGS="-v --extension --upgrade-path=${UPGRADE_PATH}"
+    make -C ${BUILDDIR}/regress check || exit 1
+  else
+    echo "Missing script for $UPGRADE_PATH upgrade" >&2
+  fi
+done

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/postgis.git



More information about the Pkg-grass-devel mailing list