mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Dump identity of alternative location, if any.
This commit is contained in:
@ -6,7 +6,7 @@
|
|||||||
# and "pg_group" tables, which belong to the whole installation rather
|
# and "pg_group" tables, which belong to the whole installation rather
|
||||||
# than any one individual database.
|
# 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`
|
CMDNAME=`basename $0`
|
||||||
|
|
||||||
@ -204,8 +204,8 @@ fi
|
|||||||
# For each database, run pg_dump to dump the contents of that database.
|
# For each database, run pg_dump to dump the contents of that database.
|
||||||
|
|
||||||
$PSQL -d template1 -At -F ' ' \
|
$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';" | \
|
-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 ; do
|
while read DATABASE DBOWNER ENCODING DBPATH; do
|
||||||
echo
|
echo
|
||||||
echo "--"
|
echo "--"
|
||||||
echo "-- Database $DATABASE"
|
echo "-- Database $DATABASE"
|
||||||
@ -216,11 +216,17 @@ while read DATABASE DBOWNER ENCODING ; do
|
|||||||
echo "DROP DATABASE \"$DATABASE\";"
|
echo "DROP DATABASE \"$DATABASE\";"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ x"$MULTIBYTE" != x"" ] ; then
|
createdbcmd="CREATE DATABASE \"$DATABASE\""
|
||||||
echo "CREATE DATABASE \"$DATABASE\" WITH ENCODING = '$ENCODING';"
|
if [ x"$DBPATH" != x"" ] || [ x"$MULTIBYTE" != x"" ]; then
|
||||||
else
|
createdbcmd="$createdbcmd WITH"
|
||||||
echo "CREATE DATABASE \"$DATABASE\";"
|
|
||||||
fi
|
fi
|
||||||
|
if [ x"$DBPATH" != x"" ] ; then
|
||||||
|
createdbcmd="$createdbcmd LOCATION = '$DBPATH'"
|
||||||
|
fi
|
||||||
|
if [ x"$MULTIBYTE" != x"" ] ; then
|
||||||
|
createdbcmd="$createdbcmd ENCODING = '$ENCODING'"
|
||||||
|
fi
|
||||||
|
echo "$createdbcmd;"
|
||||||
|
|
||||||
echo "${BS}connect $DATABASE $DBOWNER"
|
echo "${BS}connect $DATABASE $DBOWNER"
|
||||||
$PGDUMP "$DATABASE"
|
$PGDUMP "$DATABASE"
|
||||||
|
Reference in New Issue
Block a user