Commit 52d02657 authored by Bruce Momjian's avatar Bruce Momjian

it seems in the beta2 release DBUSERID in pg_dumpall is the _name_ of the

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
parent cfa929f6
...@@ -51,16 +51,11 @@ psql -l -A -q -t | grep '|' | tr '|' ' ' | \ ...@@ -51,16 +51,11 @@ psql -l -A -q -t | grep '|' | tr '|' ' ' | \
grep -v '^template1 ' | \ grep -v '^template1 ' | \
while read DATABASE DBUSERID ENCODING DATAPATH while read DATABASE DBUSERID ENCODING DATAPATH
do do
POSTGRES_USER="`echo \" \ echo "${BS}connect template1 $DBUSERID"
select usename \
from pg_shadow \
where usename = $DBUSERID; \" | \
psql -A -q -t template1`"
echo "${BS}connect template1 $POSTGRES_USER"
if pg_encoding $ENCODING >/dev/null 2>&1 if pg_encoding $ENCODING >/dev/null 2>&1
then then
echo "create database $DATABASE with encoding='`pg_encoding $ENCODING`';" echo "create database $DATABASE with encoding='$ENCODING';"
else else
echo "create database $DATABASE;" echo "create database $DATABASE;"
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment