From 5d0839b04385081192a2e325dd373181c8b2dc62 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Sun, 8 Aug 2004 18:10:32 +0000 Subject: [PATCH] reduced psql invocation to a single one. git-svn-id: http://svn.osgeo.org/postgis/trunk@671 b70326c6-7e19-0410-871a-916f4a2858ee --- utils/postgis_restore.pl | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/utils/postgis_restore.pl b/utils/postgis_restore.pl index 6fcae7830..f7a20968d 100644 --- a/utils/postgis_restore.pl +++ b/utils/postgis_restore.pl @@ -367,12 +367,22 @@ print "Creating db ($dbname)\n"; `createdb $dbname`; print "Adding plpgsql\n"; `createlang plpgsql $dbname`; + +open( PSQL, "| psql $dbname") || die "Can't run psql\n"; print "Sourcing $postgissql\n"; -`psql -f $postgissql $dbname`; +#`psql -f $postgissql $dbname`; +open(INPUT, "<$postgissql") || die "Can't read $postgissql\n"; +while() { print PSQL; } +close(INPUT); print "Dropping geometry_columns and spatial_ref_sys\n"; -`psql -c "drop table geometry_columns; drop table spatial_ref_sys;" $dbname`; +#`psql -c "drop table geometry_columns; drop table spatial_ref_sys;" $dbname`; +print PSQL "DROP TABLE geometry_columns;"; +print PSQL "DROP TABLE spatial_ref_sys;"; print "Restoring ascii dump $dumpascii\n"; -`psql -f $dumpascii $dbname`; +#`psql -f $dumpascii $dbname`; +open(INPUT, "<$dumpascii") || die "Can't read $postgissql\n"; +while() { print PSQL; } +close(INPUT); exit; -- 2.40.0