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
69cc16f4
Commit
69cc16f4
authored
25 years ago
by
Tom Lane
Browse files
Options
Downloads
Patches
Plain Diff
Quote database name so that not-all-lowercase names are handled safely.
parent
61f5e13c
Branches
Branches containing commit
Tags
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
+7
-7
7 additions, 7 deletions
src/bin/pg_dump/pg_dumpall
with
7 additions
and
7 deletions
src/bin/pg_dump/pg_dumpall
+
7
−
7
View file @
69cc16f4
...
...
@@ -5,7 +5,7 @@
# 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.2
6
2000/05/
0
5
17:50:38
tgl Exp $
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/pg_dumpall,v 1.2
7
2000/05/
2
5
20:18:15
tgl Exp $
#
# to adapt to System V vs. BSD 'echo'
if
echo
'\\'
|
grep
'\\\\'
>
/dev/null 2>&1
...
...
@@ -65,9 +65,9 @@ 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
'|'
' '
|
\
psql
-A
-q
-t
-c
"select
datname,datdba,encoding
from pg_database"
template1 |
grep
'|'
|
tr
'|'
' '
|
\
grep
-v
'^template1 '
|
\
while
read
DATABASE DBUSERID ENCODING
DATAPATH
while
read
DATABASE DBUSERID ENCODING
do
DBUSERNAME
=
"
`
echo
\"
\
select
usename
\
...
...
@@ -79,13 +79,13 @@ do
if
sh
-c
"pg_encoding
$ENCODING
"
>
/dev/null 2>&1
then
echo
"create database
$DATABASE
with encoding='
`
pg_encoding
$ENCODING
`
';"
echo
"create database
\"
$DATABASE
\"
with encoding='
`
pg_encoding
$ENCODING
`
';"
else
echo
"create database
$DATABASE
;"
echo
"create database
\"
$DATABASE
\"
;"
fi
echo
"
${
BS
}
connect
$DATABASE
$
POSTGRES_USER
"
pg_dump
${
1
+
"
$@
"
}
$DATABASE
echo
"
${
BS
}
connect
$DATABASE
$
DBUSERNAME
"
pg_dump
${
1
+
"
$@
"
}
"
$DATABASE
"
if
[
"
$?
"
-ne
0
]
then
echo
"pg_dump failed on
$DATABASE
, exiting"
1>&2
exit
1
...
...
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