Skip to content

Commit ea89acc

Browse files
committed
Rename pg_user to pg_shadow.
1 parent 0bad7c1 commit ea89acc

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/bin/pg_dump/pg_dumpall

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# pg_dumpall [pg_dump parameters]
44
# dumps all databases to standard output
5-
# It also dumps the pg_user table
5+
# It also dumps the pg_shadow table
66
#
77
# to adapt to System V vs. BSD 'echo'
88
#set -x
@@ -30,29 +30,29 @@ echo "${BS}connect template1"
3030
# we don't use POSTGRES_SUPER_USER_ID because the postgres super user id
3131
# could be different on the two installations
3232
#
33-
echo "select datdba into table tmp_pguser \
33+
echo "select datdba into table tmp_pg_shadow \
3434
from pg_database where datname = 'template1';"
35-
echo "delete from pg_user where usesysid <> tmp_pguser.datdba;"
36-
echo "drop table tmp_pguser;"
35+
echo "delete from pg_shadow where usesysid <> tmp_pg_shadow.datdba;"
36+
echo "drop table tmp_pg_shadow;"
3737
#
3838
# load all the non-postgres users
3939
#
40-
echo "copy pg_user from stdin;"
40+
echo "copy pg_shadow from stdin;"
4141
psql -q template1 <<END
42-
select pg_user.*
43-
into table tmp_pg_user
44-
from pg_user
42+
select pg_shadow.*
43+
into table tmp_pg_shadow
44+
from pg_shadow
4545
where usesysid <> $POSTGRES_SUPER_USER_ID;
46-
copy tmp_pg_user to stdout;
47-
drop table tmp_pg_user;
46+
copy tmp_pg_shadow to stdout;
47+
drop table tmp_pg_shadow;
4848
END
4949
echo "${BS}."
5050
psql -l -A -q -t| tr '|' ' ' | grep -v '^template1 ' | \
5151
while read DATABASE DBUSERID DATAPATH
5252
do
5353
POSTGRES_USER="`echo \" \
5454
select usename \
55-
from pg_user \
55+
from pg_shadow \
5656
where usesysid = $DBUSERID; \" | \
5757
psql -A -q -t template1`"
5858
echo "${BS}connect template1 $POSTGRES_USER"

0 commit comments

Comments
 (0)