This package includes the extension files needed to 
use the new CREATE EXTENSION/ALTER EXTENSION syntax for PostGIS installation.


To use the new extension approach for installing PostGIS.
Edit the makepostgisdb_using_extensions.bat 
changing PGINSTALL to path of your PostgreSQL 9.1 install
and THEDB to the name of new database you want to create.
This will create a new postgis database.


Sometimes depending on how locked down your system is, you may not be able to copy easily with batch script
or you may want to just do the old fashioned way which is

copy over the folders of this install to your PostgreSQL install folder (folder names should match up)



If you want to spatially enable a different one:
If you use PgAdmin, you should see at least 3 new extensions:
postgis  (this has geometry/geography/raster support)
postgis_topology
postgis_tiger_geocoder


which you can install with PgAdmin by selecting from the extensions drop down.

Alternatively you can use the new SQL syntax to install in your database

CREATE EXTENSION postgis;
CREATE EXTENSION postgis_topology;
CREATE EXTENSION fuzzystrmatch; -- required for postgis_tiger_geocoder
CREATE EXTENSION postgis_tiger_geocoder;
-- this may or may not be included in your package
-- but if included allows 
-- you to use the alternative pagc_normalize_addresss function of postgis_tiger_geocoder;
CREATE EXTENSION address_standardizer;

-- Upgrading extension --
To upgrade an extension, it's just as easy. If you are using PgAdmin,
go to the extensions section and the postgis / postgis_topology.
Select the version drop down and bump what you have currently to the latest.

-- What to do if you get an error that there is no migration path
-- from your current to new --
If you get an error message about not able to migrate from your current version to new and you know you are using
PostGIS 2.0+, then you can copy one of the share/extension/postgis_.. 
because no migration path, you can create a migration path file
by copying share/extensions/postgis--2.0.3--2.1.0...sql (and rename the 2.0.3 to version you are currently running)

you need to do a HARD UPGRADE if you are running a verson of PostGIS prior to 2.0.0beta3

Hard upgrade is pretty simple if your backup was using extensions:
1) Backup your database
2) CREATE a new database and run:
CREATE EXTENSION postgis;
CREATE EXTENSION postgis_topology;
CREATE EXTENSION fuzzystrmatch; -- required for postgis_tiger_geocoder
CREATE EXTENSION postgis_tiger_geocoder;

3) Restore your old database backup onto the new one.
Since the postgis extension is installed, you might get a restore failure notice about postgis and postgis_topology
extensions not restored because they are already present.  You can safely ignore those notices.

