Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
ea89acc4
Commit
ea89acc4
authored
Mar 06, 1998
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename pg_user to pg_shadow.
parent
0bad7c11
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
src/bin/pg_dump/pg_dumpall
src/bin/pg_dump/pg_dumpall
+11
-11
No files found.
src/bin/pg_dump/pg_dumpall
View file @
ea89acc4
...
...
@@ -2,7 +2,7 @@
#
# pg_dumpall [pg_dump parameters]
# dumps all databases to standard output
# It also dumps the pg_
user
table
# It also dumps the pg_
shadow
table
#
# to adapt to System V vs. BSD 'echo'
#set -x
...
...
@@ -30,21 +30,21 @@ echo "${BS}connect template1"
# we don't use POSTGRES_SUPER_USER_ID because the postgres super user id
# could be different on the two installations
#
echo
"select datdba into table tmp_pg
user
\
echo
"select datdba into table tmp_pg
_shadow
\
from pg_database where datname = 'template1';"
echo
"delete from pg_
user where usesysid <> tmp_pguser
.datdba;"
echo
"drop table tmp_pg
user
;"
echo
"delete from pg_
shadow where usesysid <> tmp_pg_shadow
.datdba;"
echo
"drop table tmp_pg
_shadow
;"
#
# load all the non-postgres users
#
echo
"copy pg_
user
from stdin;"
echo
"copy pg_
shadow
from stdin;"
psql
-q
template1
<<
END
select pg_
user
.*
into table tmp_pg_
user
from pg_
user
select pg_
shadow
.*
into table tmp_pg_
shadow
from pg_
shadow
where usesysid <>
$POSTGRES_SUPER_USER_ID
;
copy tmp_pg_
user
to stdout;
drop table tmp_pg_
user
;
copy tmp_pg_
shadow
to stdout;
drop table tmp_pg_
shadow
;
END
echo
"
${
BS
}
."
psql
-l
-A
-q
-t
|
tr
'|'
' '
|
grep
-v
'^template1 '
|
\
...
...
@@ -52,7 +52,7 @@ while read DATABASE DBUSERID DATAPATH
do
POSTGRES_USER
=
"
`
echo
\"
\
select
usename
\
from pg_
user
\
from pg_
shadow
\
where usesysid
=
$DBUSERID
;
\"
|
\
psql
-A
-q
-t
template1
`
"
echo
"
${
BS
}
connect template1
$POSTGRES_USER
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment