mirror of
https://github.com/postgres/postgres.git
synced 2025-05-01 01:04:50 +03:00
Cleanup in use of IFS.
This commit is contained in:
parent
a521d5a25e
commit
0c9790e616
@ -6,7 +6,7 @@
|
|||||||
# and "pg_group" tables, which belong to the whole installation rather
|
# and "pg_group" tables, which belong to the whole installation rather
|
||||||
# than any one individual database.
|
# than any one individual database.
|
||||||
#
|
#
|
||||||
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/pg_dumpall.sh,v 1.19 2002/04/11 21:16:28 momjian Exp $
|
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/pg_dumpall.sh,v 1.20 2002/04/11 21:22:27 momjian Exp $
|
||||||
|
|
||||||
CMDNAME="`basename $0`"
|
CMDNAME="`basename $0`"
|
||||||
|
|
||||||
@ -29,8 +29,8 @@ if echo "$0" | grep '/' > /dev/null 2>&1 ; then
|
|||||||
PGPATH=`echo "$0" | sed 's,/[^/]*$,,'` # (dirname command is not portable)
|
PGPATH=`echo "$0" | sed 's,/[^/]*$,,'` # (dirname command is not portable)
|
||||||
else
|
else
|
||||||
# look for it in PATH ('which' command is not portable)
|
# look for it in PATH ('which' command is not portable)
|
||||||
echo "$PATH" | sed 's/:/\
|
echo "$PATH" | sed "s/:/$NL/g" |
|
||||||
/g' | while :; do
|
while :; do
|
||||||
IFS="$NL"
|
IFS="$NL"
|
||||||
read dir || break
|
read dir || break
|
||||||
IFS="$_IFS"
|
IFS="$_IFS"
|
||||||
@ -203,8 +203,8 @@ echo "DELETE FROM pg_group;"
|
|||||||
echo
|
echo
|
||||||
|
|
||||||
|
|
||||||
$PSQL -d template1 -At -F '
|
$PSQL -d template1 -At -F "$NL" \
|
||||||
' -c 'SELECT groname,grosysid,grolist FROM pg_group;' | \
|
-c 'SELECT groname,grosysid,grolist FROM pg_group;' | \
|
||||||
while : ; do
|
while : ; do
|
||||||
IFS="$NL"
|
IFS="$NL"
|
||||||
read GRONAME || break
|
read GRONAME || break
|
||||||
@ -232,8 +232,8 @@ exec 4<&0
|
|||||||
# We skip databases marked not datallowconn, since we'd be unable to
|
# We skip databases marked not datallowconn, since we'd be unable to
|
||||||
# connect to them anyway (and besides, we don't want to dump template0).
|
# connect to them anyway (and besides, we don't want to dump template0).
|
||||||
|
|
||||||
$PSQL -d template1 -At -F '
|
$PSQL -d template1 -At -F "$NL" \
|
||||||
' -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 ORDER BY 1;" | \
|
-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 ORDER BY 1;" | \
|
||||||
while read DATABASE ; do
|
while read DATABASE ; do
|
||||||
IFS="$NL"
|
IFS="$NL"
|
||||||
read DBOWNER
|
read DBOWNER
|
||||||
@ -262,8 +262,8 @@ while read DATABASE ; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
$PSQL -d template1 -At -F '
|
$PSQL -d template1 -At -F "$NL" \
|
||||||
' -c "SELECT datname FROM pg_database WHERE datallowconn ORDER BY 1;" | \
|
-c "SELECT datname FROM pg_database WHERE datallowconn ORDER BY 1;" | \
|
||||||
while :; do
|
while :; do
|
||||||
IFS="$NL"
|
IFS="$NL"
|
||||||
read DATABASE || break
|
read DATABASE || break
|
||||||
|
Loading…
x
Reference in New Issue
Block a user