Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
ea89acc4
Commit
ea89acc4
authored
27 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
Rename pg_user to pg_shadow.
parent
0bad7c11
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/bin/pg_dump/pg_dumpall
+11
-11
11 additions, 11 deletions
src/bin/pg_dump/pg_dumpall
with
11 additions
and
11 deletions
src/bin/pg_dump/pg_dumpall
+
11
−
11
View file @
ea89acc4
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
#
#
# pg_dumpall [pg_dump parameters]
# pg_dumpall [pg_dump parameters]
# dumps all databases to standard output
# 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'
# to adapt to System V vs. BSD 'echo'
#set -x
#set -x
...
@@ -30,21 +30,21 @@ echo "${BS}connect template1"
...
@@ -30,21 +30,21 @@ echo "${BS}connect template1"
# we don't use POSTGRES_SUPER_USER_ID because the postgres super user id
# we don't use POSTGRES_SUPER_USER_ID because the postgres super user id
# could be different on the two installations
# 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';"
from pg_database where datname = 'template1';"
echo
"delete from pg_
user
where usesysid <> tmp_pg
user
.datdba;"
echo
"delete from pg_
shadow
where usesysid <> tmp_pg
_shadow
.datdba;"
echo
"drop table tmp_pg
user
;"
echo
"drop table tmp_pg
_shadow
;"
#
#
# load all the non-postgres users
# load all the non-postgres users
#
#
echo
"copy pg_
user
from stdin;"
echo
"copy pg_
shadow
from stdin;"
psql
-q
template1
<<
END
psql
-q
template1
<<
END
select pg_
user
.*
select pg_
shadow
.*
into table tmp_pg_
user
into table tmp_pg_
shadow
from pg_
user
from pg_
shadow
where usesysid <>
$POSTGRES_SUPER_USER_ID
;
where usesysid <>
$POSTGRES_SUPER_USER_ID
;
copy tmp_pg_
user
to stdout;
copy tmp_pg_
shadow
to stdout;
drop table tmp_pg_
user
;
drop table tmp_pg_
shadow
;
END
END
echo
"
${
BS
}
."
echo
"
${
BS
}
."
psql
-l
-A
-q
-t
|
tr
'|'
' '
|
grep
-v
'^template1 '
|
\
psql
-l
-A
-q
-t
|
tr
'|'
' '
|
grep
-v
'^template1 '
|
\
...
@@ -52,7 +52,7 @@ while read DATABASE DBUSERID DATAPATH
...
@@ -52,7 +52,7 @@ while read DATABASE DBUSERID DATAPATH
do
do
POSTGRES_USER
=
"
`
echo
\"
\
POSTGRES_USER
=
"
`
echo
\"
\
select
usename
\
select
usename
\
from pg_
user
\
from pg_
shadow
\
where usesysid
=
$DBUSERID
;
\"
|
\
where usesysid
=
$DBUSERID
;
\"
|
\
psql
-A
-q
-t
template1
`
"
psql
-A
-q
-t
template1
`
"
echo
"
${
BS
}
connect template1
$POSTGRES_USER
"
echo
"
${
BS
}
connect template1
$POSTGRES_USER
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment