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

Commit 7e44f8f

Browse files
committed
For missing owner of database, default to superuser.
1 parent e01e14e commit 7e44f8f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/bin/pg_dump/pg_dumpall.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# and "pg_group" tables, which belong to the whole installation rather
77
# than any one individual database.
88
#
9-
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/pg_dumpall.sh,v 1.9 2000/12/19 22:12:47 petere Exp $
9+
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/pg_dumpall.sh,v 1.10 2001/01/25 17:28:15 petere Exp $
1010

1111
CMDNAME=`basename $0`
1212

@@ -192,7 +192,7 @@ test "$globals_only" = yes && exit 0
192192
# connect to them anyway (and besides, we don't want to dump template0).
193193

194194
$PSQL -d template1 -At -F ' ' \
195-
-c "SELECT datname, usename, pg_encoding_to_char(d.encoding), datistemplate, datpath FROM pg_database d LEFT JOIN pg_shadow u ON (datdba = usesysid) WHERE datallowconn;" | \
195+
-c "SELECT datname, coalesce(usename, (select usename from pg_shadow where usesysid=(select datdba from pg_database where datname='template0'))), pg_encoding_to_char(d.encoding), datistemplate, datpath FROM pg_database d LEFT JOIN pg_shadow u ON (datdba = usesysid) WHERE datallowconn;" | \
196196
while read DATABASE DBOWNER ENCODING ISTEMPLATE DBPATH; do
197197
echo
198198
echo "--"

0 commit comments

Comments
 (0)