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
604f4a69
Commit
604f4a69
authored
Jan 19, 1997
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update handling of backslashes, and pg_user dump.
parent
6ffae202
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
+15
-8
src/bin/pg_dump/pg_dumpall
src/bin/pg_dump/pg_dumpall
+15
-8
No files found.
src/bin/pg_dump/pg_dumpall
View file @
604f4a69
...
...
@@ -4,22 +4,29 @@
# dumps all databases to standard output
# It also dumps the pg_user table
#
# to adapt to System V vs. BSD 'echo'
set
-x
if
echo
'\\'
|
grep
'\\\\'
>
/dev/null 2>&1
then
BS
=
'\'
# BSD
else
BS
=
'\\'
# System V
fi
psql
-l
-A
-q
-t
|cut
-d
"|"
-f1
|
grep
-v
'^template1$'
|
\
while
read
DATABASE
do
/bin/echo
'\connect template1'
/bin/
echo
"create database
$DATABASE
;"
/bin/echo
'\connect'
"
$DATABASE
"
echo
"
${
BS
}
connect template1"
echo
"create database
$DATABASE
;"
echo
"
${
BS
}
connect
$DATABASE
"
pg_dump
"
$@
"
$DATABASE
done
/bin/echo
'\connect template1'
/bin/echo
'copy pg_user from stdin;'
echo
"
${
BS
}
connect template1"
echo
"copy pg_user from stdin;"
#
# Dump everyone but the postgres user
# initdb creates him
#
POSTGRES_SUPER_USER_ID
=
"
`
psql
-q
template1
<<
END
\\
t
POSTGRES_SUPER_USER_ID
=
"
`
psql
-A
-q
-t
template1
<<
END
select datdba
from pg_database
where datname = 'template1';
...
...
@@ -31,4 +38,4 @@ where usesysid <> $POSTGRES_SUPER_USER_ID;
copy tmp_pg_user to stdout;
drop table tmp_pg_user;
END
/bin/echo
'\.'
echo
"
${
BS
}
."
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