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
5ad7d65d
Commit
5ad7d65d
authored
Jan 22, 2004
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix incorrect dumping of database LOCATION from 7.0.* servers.
Per report from Mattias Kregert.
parent
feaf66aa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
4 deletions
+19
-4
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.c
+9
-2
src/bin/pg_dump/pg_dumpall.c
src/bin/pg_dump/pg_dumpall.c
+10
-2
No files found.
src/bin/pg_dump/pg_dump.c
View file @
5ad7d65d
...
...
@@ -12,7 +12,7 @@
* by PostgreSQL
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.36
2 2004/01/07 00:44:21
tgl Exp $
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.36
3 2004/01/22 19:09:32
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1149,12 +1149,19 @@ dumpDatabase(Archive *AH)
}
else
{
/*
* In 7.0, datpath is either the same as datname, or the user-given
* location with "/" and the datname appended. We must strip this
* junk off to produce a correct LOCATION value.
*/
appendPQExpBuffer
(
dbQry
,
"SELECT "
"(SELECT oid FROM pg_class WHERE relname = 'pg_database') AS tableoid, "
"oid, "
"(SELECT usename FROM pg_user WHERE usesysid = datdba) as dba, "
"pg_encoding_to_char(encoding) as encoding, "
"datpath "
"CASE WHEN length(datpath) > length(datname) THEN "
"substr(datpath,1,length(datpath)-length(datname)-1) "
"ELSE '' END as datpath "
"FROM pg_database "
"WHERE datname = "
);
appendStringLiteral
(
dbQry
,
datname
,
true
);
...
...
src/bin/pg_dump/pg_dumpall.c
View file @
5ad7d65d
...
...
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.
29 2003/11/29 19:52:05 pgsq
l Exp $
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.
30 2004/01/22 19:09:32 tg
l Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -430,6 +430,10 @@ dumpCreateDB(PGconn *conn)
else
{
/*
* In 7.0, datpath is either the same as datname, or the user-given
* location with "/" and the datname appended. We must strip this
* junk off to produce a correct LOCATION value.
*
* Note: 7.0 fails to cope with sub-select in COALESCE, so just
* deal with getting a NULL by not printing any OWNER clause.
*/
...
...
@@ -437,7 +441,11 @@ dumpCreateDB(PGconn *conn)
"SELECT datname, "
"(select usename from pg_shadow where usesysid=datdba), "
"pg_encoding_to_char(d.encoding), "
"'f' as datistemplate, datpath, '' as datacl "
"'f' as datistemplate, "
"CASE WHEN length(datpath) > length(datname) THEN "
"substr(datpath,1,length(datpath)-length(datname)-1) "
"ELSE '' END as datpath, "
"'' as datacl "
"FROM pg_database d "
"ORDER BY 1"
);
}
...
...
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