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
1f793609
Commit
1f793609
authored
Nov 22, 2002
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Quote database name properly when invoking pg_dump. Per report from
Christopher Kings-Lynne.
parent
fadcb011
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
src/bin/pg_dump/pg_dumpall.c
src/bin/pg_dump/pg_dumpall.c
+17
-3
No files found.
src/bin/pg_dump/pg_dumpall.c
View file @
1f793609
...
...
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.
9 2002/10/18 22:05:36 petere
Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.
10 2002/11/22 03:09:43 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -589,10 +589,23 @@ static int
runPgDump
(
const
char
*
dbname
)
{
PQExpBuffer
cmd
=
createPQExpBuffer
();
const
char
*
p
;
int
ret
;
appendPQExpBuffer
(
cmd
,
"%s %s -X use-set-session-authorization -Fp %s"
,
pgdumploc
,
pgdumpopts
->
data
,
dbname
);
appendPQExpBuffer
(
cmd
,
"%s %s -X use-set-session-authorization -Fp '"
,
pgdumploc
,
pgdumpopts
->
data
);
/* Shell quoting is not quite like SQL quoting, so can't use fmtId */
for
(
p
=
dbname
;
*
p
;
p
++
)
{
if
(
*
p
==
'\''
)
appendPQExpBuffer
(
cmd
,
"'
\"
'
\"
'"
);
else
appendPQExpBufferChar
(
cmd
,
*
p
);
}
appendPQExpBufferChar
(
cmd
,
'\''
);
if
(
verbose
)
fprintf
(
stderr
,
_
(
"%s: running %s
\n
"
),
progname
,
cmd
->
data
);
...
...
@@ -600,6 +613,7 @@ runPgDump(const char *dbname)
fflush
(
stderr
);
ret
=
system
(
cmd
->
data
);
destroyPQExpBuffer
(
cmd
);
return
ret
;
...
...
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