[DebianGIS-dev] r1066 - packages/postgis/trunk/debian

kobold at alioth.debian.org kobold at alioth.debian.org
Mon Sep 10 09:02:06 UTC 2007


Author: kobold
Date: 2007-09-10 09:02:05 +0000 (Mon, 10 Sep 2007)
New Revision: 1066

Modified:
   packages/postgis/trunk/debian/README.Debian
   packages/postgis/trunk/debian/changelog
   packages/postgis/trunk/debian/control
Log:
Preparing the new release.


Modified: packages/postgis/trunk/debian/README.Debian
===================================================================
--- packages/postgis/trunk/debian/README.Debian	2007-09-09 21:18:38 UTC (rev 1065)
+++ packages/postgis/trunk/debian/README.Debian	2007-09-10 09:02:05 UTC (rev 1066)
@@ -160,3 +160,75 @@
 
   # have a look of spatial_ref_sys
   select * from spatial_ref_sys;
+
+
+Upgrading existing spatial databases
+====================================
+
+Upgrading existing spatial databases can be tricky as it requires
+replacement or introduction of new PostGIS object definitions.
+
+Unfortunately not all definitions can be easily replaced in 
+a live database, so sometimes your best bet is a dump/reload
+process. 
+
+PostGIS provides a SOFT UPGRADE procedure for minor or bugfix
+releases, and an HARD UPGRADE procedure for major releases.
+
+--- SOFT UPGRADE ---
+
+Soft upgrade consists of sourcing the lwpostgis_upgrade.sql
+script in your spatial database:
+
+  psql -f lwpostgis_upgrade.sql -d your_spatial_database
+
+If a soft upgrade is not possible the script will abort and 
+you will be warned about HARD UPGRADE being required,
+so do not hesitate to try a soft upgrade first.
+
+--- HARD UPGRADE ---
+
+Hard upgrade is a PostgreSQL dump/restore procedure combined 
+with a filter to selectively update PostGIS functions and 
+objects to point to a new library version.
+
+Hard upgrades are required when object definitions have changed,
+aggregates have changed or been added, and when the underlying
+PostgreSQL database itself has undergone a major update.
+
+For this purpose, PostGIS provides a utility script to restore a dump
+in "custom" format. The hard upgrade procedure is as follows:
+
+	# Create a "custom-format" dump of the database you want
+	# to upgrade (let's call it "olddb")
+	$ pg_dump -Fc olddb olddb.dump
+
+	# Restore the dump while upgrading postgis into
+	# a new database. 
+        # Note: The new database does NOT have to exist.
+	# Let's call it "newdb"
+	$ sh utils/postgis_restore.pl lwpostgis.sql newdb olddb.dump > restore.log
+
+	# Check that all restored dump objects really had to be 
+        # restored from dump and do not conflict with the 
+        # ones defined in lwpostgis.sql
+	$ grep ^KEEPING restore.log | less
+
+	# If upgrading from PostgreSQL < 8.0 to >= 8.0 you will want to 
+	# drop the attrelid, varattnum and stats columns in the geometry_columns
+	# table, which are no-more needed. Keeping them won't hurt.
+	# !!! DROPPING THEM WHEN REALLY NEEDED WILL DO HARM !!!!
+	$ psql newdb -c "ALTER TABLE geometry_columns DROP attrelid"
+	$ psql newdb -c "ALTER TABLE geometry_columns DROP varattnum"
+	$ psql newdb -c "ALTER TABLE geometry_columns DROP stats"
+
+	# The spatial_ref_sys table is restored from the dump, to 
+        # ensure your custom additions are kept, but the distributed 
+        # one might contain modification so you should backup your 
+        # entries, drop the table and source the new one.
+	# If you did make additions we assume you know how to backup them before
+	# upgrading the table. Replace it with the new like this:
+	$ psql newdb
+	newdb=> DELETE FROM spatial_ref_sys;
+	DROP
+	newdb=> \i spatial_ref_sys.sql

Modified: packages/postgis/trunk/debian/changelog
===================================================================
--- packages/postgis/trunk/debian/changelog	2007-09-09 21:18:38 UTC (rev 1065)
+++ packages/postgis/trunk/debian/changelog	2007-09-10 09:02:05 UTC (rev 1066)
@@ -1,3 +1,9 @@
+postgis (1.3.1-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Fabio Tranchitella <kobold at debian.org>  Mon, 10 Sep 2007 10:36:30 +0200
+
 postgis (1.2.1-2) unstable; urgency=low
 
   * Added build-dep from libjts-java 1.7

Modified: packages/postgis/trunk/debian/control
===================================================================
--- packages/postgis/trunk/debian/control	2007-09-09 21:18:38 UTC (rev 1065)
+++ packages/postgis/trunk/debian/control	2007-09-10 09:02:05 UTC (rev 1066)
@@ -3,9 +3,7 @@
 Priority: optional
 Maintainer: Debian GIS Project <pkg-grass-devel at lists.alioth.debian.org>
 Uploaders: Stephen Frost <sfrost at debian.org>, Fabio Tranchitella <kobold at debian.org>, Francesco Paolo Lovergine <frankie at debian.org>
-Build-Depends: debhelper (>= 5.0.0), autotools-dev, flex, bison, postgresql-server-dev-8.2,
- libgeos-dev, proj, libssl-dev, xsltproc, docbook, docbook-xsl, libpg-java, jikes-classpath,
- fastjar, libjts-java (>=1.7)
+Build-Depends: debhelper (>= 5.0.0), autotools-dev, flex, bison, postgresql-server-dev-8.2, libgeos-dev, proj, libssl-dev, xsltproc, docbook, docbook-xsl, libpg-java, jikes-classpath, fastjar, libjts-java (>=1.7)
 Standards-Version: 3.7.2
 
 Package: postgresql-8.2-postgis




More information about the Pkg-grass-devel mailing list