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
3d146180
Commit
3d146180
authored
24 years ago
by
Tom Lane
Browse files
Options
Downloads
Patches
Plain Diff
Dump contents of pg_group along with pg_shadow.
parent
570a58f4
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
+21
-2
21 additions, 2 deletions
src/bin/pg_dump/pg_dumpall
with
21 additions
and
2 deletions
src/bin/pg_dump/pg_dumpall
+
21
−
2
View file @
3d146180
...
...
@@ -2,10 +2,12 @@
#
# pg_dumpall [pg_dump parameters]
# dumps all databases to standard output
# It also dumps the pg_shadow table
# It also dumps the pg_shadow and pg_group tables, which belong to the
# whole installation rather than any one individual database.
#
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/pg_dumpall,v 1.25 2000/05/05 03:04:00 tgl Exp $
#
# to adapt to System V vs. BSD 'echo'
#set -x
if
echo
'\\'
|
grep
'\\\\'
>
/dev/null 2>&1
then
BS
=
'\'
# BSD
...
...
@@ -36,6 +38,8 @@ echo "delete from pg_shadow where usesysid <> tmp_pg_shadow.datdba;"
echo
"drop table tmp_pg_shadow;"
#
# load all the non-postgres users
# XXX this breaks badly if the layout of pg_shadow ever changes.
# It'd be better to convert the data into CREATE USER commands.
#
echo
"copy pg_shadow from stdin;"
psql
-q
template1
<<
END
...
...
@@ -47,6 +51,19 @@ copy tmp_pg_shadow to stdout;
drop table tmp_pg_shadow;
END
echo
"
${
BS
}
."
#
# copy the pg_group table too
# XXX this breaks badly if the layout of pg_group ever changes.
# It'd be better to convert the data into CREATE GROUP commands.
#
echo
"copy pg_group from stdin;"
psql
-q
template1
<<
END
copy pg_group to stdout;
END
echo
"
${
BS
}
."
#
# For each database, run pg_dump to dump the contents of that database.
#
psql
-A
-q
-t
-c
"select * from pg_database"
template1 |
grep
'|'
|
tr
'|'
' '
|
\
grep
-v
'^template1 '
|
\
while
read
DATABASE DBUSERID ENCODING DATAPATH
...
...
@@ -73,3 +90,5 @@ do
exit
1
fi
done
exit
0
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