Commit c6d103a4 authored by Peter Eisentraut's avatar Peter Eisentraut

Dump identity of alternative location, if any.

parent 929a5993
......@@ -6,7 +6,7 @@
# and "pg_group" tables, which belong to the whole installation rather
# than any one individual database.
#
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/pg_dumpall.sh,v 1.6 2000/11/02 21:13:32 petere Exp $
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/pg_dumpall.sh,v 1.7 2000/11/08 18:23:44 petere Exp $
CMDNAME=`basename $0`
......@@ -204,8 +204,8 @@ fi
# For each database, run pg_dump to dump the contents of that database.
$PSQL -d template1 -At -F ' ' \
-c "SELECT d.datname, u.usename, pg_encoding_to_char(d.encoding) FROM pg_database d, pg_shadow u WHERE d.datdba = u.usesysid AND datname <> 'template1';" | \
while read DATABASE DBOWNER ENCODING ; do
-c "SELECT d.datname, u.usename, pg_encoding_to_char(d.encoding), d.datpath FROM pg_database d, pg_shadow u WHERE d.datdba = u.usesysid AND datname <> 'template1';" | \
while read DATABASE DBOWNER ENCODING DBPATH; do
echo
echo "--"
echo "-- Database $DATABASE"
......@@ -216,11 +216,17 @@ while read DATABASE DBOWNER ENCODING ; do
echo "DROP DATABASE \"$DATABASE\";"
fi
createdbcmd="CREATE DATABASE \"$DATABASE\""
if [ x"$DBPATH" != x"" ] || [ x"$MULTIBYTE" != x"" ]; then
createdbcmd="$createdbcmd WITH"
fi
if [ x"$DBPATH" != x"" ] ; then
createdbcmd="$createdbcmd LOCATION = '$DBPATH'"
fi
if [ x"$MULTIBYTE" != x"" ] ; then
echo "CREATE DATABASE \"$DATABASE\" WITH ENCODING = '$ENCODING';"
else
echo "CREATE DATABASE \"$DATABASE\";"
createdbcmd="$createdbcmd ENCODING = '$ENCODING'"
fi
echo "$createdbcmd;"
echo "${BS}connect $DATABASE $DBOWNER"
$PGDUMP "$DATABASE"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment