From 7e44f8f9e5c8156bacd9e7c75f73dc4655fd3742 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 25 Jan 2001 17:28:15 +0000 Subject: [PATCH] For missing owner of database, default to superuser. --- src/bin/pg_dump/pg_dumpall.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/pg_dump/pg_dumpall.sh b/src/bin/pg_dump/pg_dumpall.sh index 6eae7e2df2..a3b80fe251 100644 --- a/src/bin/pg_dump/pg_dumpall.sh +++ b/src/bin/pg_dump/pg_dumpall.sh @@ -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.9 2000/12/19 22:12:47 petere Exp $ +# $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/pg_dumpall.sh,v 1.10 2001/01/25 17:28:15 petere Exp $ CMDNAME=`basename $0` @@ -192,7 +192,7 @@ test "$globals_only" = yes && exit 0 # connect to them anyway (and besides, we don't want to dump template0). $PSQL -d template1 -At -F ' ' \ - -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;" | \ + -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;" | \ while read DATABASE DBOWNER ENCODING ISTEMPLATE DBPATH; do echo echo "--" -- 2.40.0