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
f1fa94a4
Commit
f1fa94a4
authored
Aug 02, 2006
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix logic to prevent pg_dump from dumping system schemas; bug introduced
in recent -t/-n/-T/-N patch. Small style cleanups.
parent
959aee5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
18 deletions
+27
-18
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.c
+27
-18
No files found.
src/bin/pg_dump/pg_dump.c
View file @
f1fa94a4
...
...
@@ -12,7 +12,7 @@
* by PostgreSQL
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.44
4 2006/08/01 21:05:00
momjian Exp $
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.44
5 2006/08/02 21:43:43
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -625,6 +625,7 @@ main(int argc, char **argv)
/* Check schema selection flags */
resetPQExpBuffer
(
query
);
switch_include_exclude
=
true
;
for
(
this_obj_name
=
schemaList
;
this_obj_name
;
this_obj_name
=
this_obj_name
->
next
)
{
if
(
switch_include_exclude
)
...
...
@@ -686,6 +687,7 @@ main(int argc, char **argv)
/* Check table selection flags */
resetPQExpBuffer
(
query
);
switch_include_exclude
=
true
;
for
(
this_obj_name
=
tableList
;
this_obj_name
;
this_obj_name
=
this_obj_name
->
next
)
{
if
(
switch_include_exclude
)
...
...
@@ -937,21 +939,23 @@ selectDumpableNamespace(NamespaceInfo *nsinfo)
* namespaces. If specific namespaces are being dumped, dump just
* those namespaces. Otherwise, dump all non-system namespaces.
*/
nsinfo
->
dobj
.
dump
=
false
;
if
(
matchingTables
!=
NULL
)
nsinfo
->
dobj
.
dump
=
false
;
/* false */
;
else
if
(
matchingSchemas
!=
NULL
)
{
char
*
search
name
=
NULL
;
searchname
=
malloc
(
20
);
sprintf
(
search
name
,
" %d "
,
nsinfo
->
dobj
.
catId
.
oid
);
if
(
strstr
(
matchingSchemas
,
search
name
)
!=
NULL
)
char
*
search
_oid
=
malloc
(
20
)
;
sprintf
(
search
_oid
,
" %d "
,
nsinfo
->
dobj
.
catId
.
oid
);
if
(
strstr
(
matchingSchemas
,
search
_oid
)
!=
NULL
)
nsinfo
->
dobj
.
dump
=
true
;
free
(
searchname
);
free
(
search_oid
);
}
else
if
(
strncmp
(
nsinfo
->
dobj
.
name
,
"pg_"
,
3
)
==
0
||
strcmp
(
nsinfo
->
dobj
.
name
,
"information_schema"
)
==
0
)
nsinfo
->
dobj
.
dump
=
false
;
else
/* The server prevents users from creating pg_ schemas */
else
if
(
strncmp
(
nsinfo
->
dobj
.
name
,
"pg_"
,
3
)
!=
0
&&
strcmp
(
nsinfo
->
dobj
.
name
,
"information_schema"
)
!=
0
)
nsinfo
->
dobj
.
dump
=
true
;
}
...
...
@@ -968,16 +972,21 @@ selectDumpableTable(TableInfo *tbinfo)
* dump.
*/
tbinfo
->
dobj
.
dump
=
false
;
if
(
tbinfo
->
dobj
.
namespace
->
dobj
.
dump
||
matchingTables
==
NULL
)
tbinfo
->
dobj
.
dump
=
true
;
if
(
matchingTables
==
NULL
)
{
if
(
tbinfo
->
dobj
.
namespace
->
dobj
.
dump
)
tbinfo
->
dobj
.
dump
=
true
;
}
else
{
char
*
search
name
=
NULL
;
searchname
=
malloc
(
20
);
sprintf
(
search
name
,
" %d "
,
tbinfo
->
dobj
.
catId
.
oid
);
if
(
strstr
(
matchingTables
,
search
name
)
!=
NULL
)
char
*
search
_oid
=
malloc
(
20
)
;
sprintf
(
search
_oid
,
" %d "
,
tbinfo
->
dobj
.
catId
.
oid
);
if
(
strstr
(
matchingTables
,
search
_oid
)
!=
NULL
)
tbinfo
->
dobj
.
dump
=
true
;
free
(
searchname
);
free
(
search_oid
);
}
}
...
...
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