Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit d825e55

Browse files
committed
Update pg_dumpall again.
1 parent 233a52e commit d825e55

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/bin/pg_dump/pg_dumpall

+8-2
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,15 @@ psql -A -q -t -c "select * from pg_database" template1 | grep '|' | tr '|' ' ' |
5151
grep -v '^template1 ' | \
5252
while read DATABASE DBUSERID ENCODING DATAPATH
5353
do
54-
echo "${BS}connect template1 $DBUSERID"
54+
DBUSERNAME="`echo \" \
55+
select usename \
56+
from pg_user \
57+
where usesysid = $DBUSERID; \" | \
58+
psql -A -q -t template1`"
5559
56-
if pg_encoding $ENCODING >/dev/null 2>&1
60+
echo "${BS}connect template1 $DBUSERNAME"
61+
62+
if sh -c "pg_encoding $ENCODING" >/dev/null 2>&1
5763
then
5864
echo "create database $DATABASE with encoding='`pg_encoding $ENCODING`';"
5965
else

0 commit comments

Comments
 (0)