]> granicus.if.org Git - postgresql/commitdiff
it seems in the beta2 release DBUSERID in pg_dumpall is the _name_ of the
authorBruce Momjian <bruce@momjian.us>
Sun, 19 Mar 2000 02:19:43 +0000 (02:19 +0000)
committerBruce Momjian <bruce@momjian.us>
Sun, 19 Mar 2000 02:19:43 +0000 (02:19 +0000)
user, so it doesn't need to be translated from the number to the name.

also ``create database ...'' does not take numbers for the encoding, so
the ENCODING variable does not need to be translated to a number, but left
as the text representation.  a patch is supplied to make the changes i
have found to work.  i was successful dumping and reloading my database
after these changes.
-

John M. Flinchbaugh

src/bin/pg_dump/pg_dumpall

index 1402b3ffdf3c838d7aab1227b66c3eb1234bc22b..586e75d530ca164ed11361f17996ebb3e48f8c3c 100644 (file)
@@ -51,16 +51,11 @@ psql -l -A -q -t | grep '|' | tr '|' ' ' | \
 grep -v '^template1 ' | \
 while read DATABASE DBUSERID ENCODING DATAPATH
 do
-       POSTGRES_USER="`echo \" \
-               select usename \
-               from pg_shadow \
-               where usename = $DBUSERID; \" | \
-               psql -A -q -t template1`"
-       echo "${BS}connect template1 $POSTGRES_USER"
+       echo "${BS}connect template1 $DBUSERID"
 
        if pg_encoding $ENCODING >/dev/null 2>&1
        then
-               echo "create database $DATABASE with encoding='`pg_encoding $ENCODING`';"
+               echo "create database $DATABASE with encoding='$ENCODING';"
        else
                echo "create database $DATABASE;"
        fi