- #2123, ST_FromGDALRaster
* Enhancements *
+
- #823, tiger geocoder: Make loader_generate_script download portion
less greedy
- #826, raster2pgsql no longer defaults to padding tiles. Flag -P
- #2202, Make libjson-c optional (--without-json configure switch)
- #2231, raster2pgsql supports user naming of filename column with -n
- #2200, ST_Union(raster, uniontype) unions all bands of all rasters
+ - #2264, postgis_restore.pl support for dump with postgis in custom schema
* Fixes *
my $me = $0;
my $usage = qq{
-Usage: $me [-v] <dumpfile>
+Usage: $me [-v] [-s schema] <dumpfile>
Restore a custom dump (pg_dump -Fc) of a PostGIS-enabled database.
First dump the old database: pg_dump -Fc MYDB > MYDB.dmp
Then create a new database: createdb NEWDB
};
my $DEBUG = 0;
+my $POSTGIS_SCHEMA;
# NOTE: the SRID limits here are being discussed:
# http://postgis.refractions.net/pipermail/postgis-devel/2012-February/018463.html
my $SRID_MAXIMUM = @SRID_MAXIMUM@;
my $SRID_USER_MAXIMUM = @SRID_USER_MAXIMUM@;
-if ( @ARGV && $ARGV[0] eq '-v' ) {
- $DEBUG = 1;
- shift(@ARGV);
+while (@ARGV && $ARGV[0] =~ /-/) {
+ if ( $ARGV[0] eq '-v' ) {
+ $DEBUG = 1;
+ shift(@ARGV);
+ }
+ elsif ( $ARGV[0] eq '-s' ) {
+ shift(@ARGV);
+ $POSTGIS_SCHEMA = shift(@ARGV);
+ }
}
die $usage if (@ARGV < 1);
print STDERR " Writing ASCII to stdout...\n";
open( INPUT, "pg_restore -L $manifest $dumpfile |") || die "$me:\tCan't run pg_restore\n";
+if ( defined $POSTGIS_SCHEMA ) {
+ print STDOUT "SET search_path = \"" . $POSTGIS_SCHEMA . "\";\n";
+}
+
#
# Disable topology metadata tables triggers to allow for population
# in arbitrary order.
}
+if ( defined $POSTGIS_SCHEMA ) {
+ print STDOUT "SET search_path = \"" . $POSTGIS_SCHEMA . "\";\n";
+}
+
if ( $hasTopology ) {
# Re-enable topology.layer table triggers