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
96e1cb4c
Commit
96e1cb4c
authored
May 12, 2017
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pg_dump: Add --no-publications option
Author: Michael Paquier <michael.paquier@gmail.com>
parent
b807f598
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
49 additions
and
1 deletion
+49
-1
doc/src/sgml/ref/pg_dump.sgml
doc/src/sgml/ref/pg_dump.sgml
+9
-0
doc/src/sgml/ref/pg_dumpall.sgml
doc/src/sgml/ref/pg_dumpall.sgml
+9
-0
doc/src/sgml/ref/pg_restore.sgml
doc/src/sgml/ref/pg_restore.sgml
+10
-0
src/bin/pg_dump/pg_backup.h
src/bin/pg_dump/pg_backup.h
+2
-0
src/bin/pg_dump/pg_backup_archiver.c
src/bin/pg_dump/pg_backup_archiver.c
+5
-0
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.c
+5
-1
src/bin/pg_dump/pg_dumpall.c
src/bin/pg_dump/pg_dumpall.c
+5
-0
src/bin/pg_dump/pg_restore.c
src/bin/pg_dump/pg_restore.c
+4
-0
No files found.
doc/src/sgml/ref/pg_dump.sgml
View file @
96e1cb4c
...
...
@@ -789,6 +789,15 @@ PostgreSQL documentation
</listitem>
</varlistentry>
<varlistentry>
<term><option>--no-publications</option></term>
<listitem>
<para>
Do not dump publications.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--no-security-labels</option></term>
<listitem>
...
...
doc/src/sgml/ref/pg_dumpall.sgml
View file @
96e1cb4c
...
...
@@ -345,6 +345,15 @@ PostgreSQL documentation
</listitem>
</varlistentry>
<varlistentry>
<term><option>--no-publications</option></term>
<listitem>
<para>
Do not dump publications.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--no-security-labels</option></term>
<listitem>
...
...
doc/src/sgml/ref/pg_restore.sgml
View file @
96e1cb4c
...
...
@@ -581,6 +581,16 @@
</listitem>
</varlistentry>
<varlistentry>
<term><option>--no-publications</option></term>
<listitem>
<para>
Do not output commands to restore publications, even if the archive
contains them.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--no-security-labels</option></term>
<listitem>
...
...
src/bin/pg_dump/pg_backup.h
View file @
96e1cb4c
...
...
@@ -74,6 +74,7 @@ typedef struct _restoreOptions
int
dump_inserts
;
int
column_inserts
;
int
if_exists
;
int
no_publications
;
/* Skip publication entries */
int
no_security_labels
;
/* Skip security label entries */
int
no_subscriptions
;
/* Skip subscription entries */
int
strict_names
;
...
...
@@ -146,6 +147,7 @@ typedef struct _dumpOptions
int
column_inserts
;
int
if_exists
;
int
no_security_labels
;
int
no_publications
;
int
no_subscriptions
;
int
no_synchronized_snapshots
;
int
no_unlogged_table_data
;
...
...
src/bin/pg_dump/pg_backup_archiver.c
View file @
96e1cb4c
...
...
@@ -166,6 +166,7 @@ dumpOptionsFromRestoreOptions(RestoreOptions *ropt)
dopt
->
disable_dollar_quoting
=
ropt
->
disable_dollar_quoting
;
dopt
->
dump_inserts
=
ropt
->
dump_inserts
;
dopt
->
no_publications
=
ropt
->
no_publications
;
dopt
->
no_security_labels
=
ropt
->
no_security_labels
;
dopt
->
no_subscriptions
=
ropt
->
no_subscriptions
;
dopt
->
lockWaitTimeout
=
ropt
->
lockWaitTimeout
;
...
...
@@ -2792,6 +2793,10 @@ _tocEntryRequired(TocEntry *te, teSection curSection, RestoreOptions *ropt)
if
(
ropt
->
aclsSkip
&&
_tocEntryIsACL
(
te
))
return
0
;
/* If it's a publication, maybe ignore it */
if
(
ropt
->
no_publications
&&
strcmp
(
te
->
desc
,
"PUBLICATION"
)
==
0
)
return
0
;
/* If it's security labels, maybe ignore it */
if
(
ropt
->
no_security_labels
&&
strcmp
(
te
->
desc
,
"SECURITY LABEL"
)
==
0
)
return
0
;
...
...
src/bin/pg_dump/pg_dump.c
View file @
96e1cb4c
...
...
@@ -352,6 +352,7 @@ main(int argc, char **argv)
{
"snapshot"
,
required_argument
,
NULL
,
6
},
{
"strict-names"
,
no_argument
,
&
strict_names
,
1
},
{
"use-set-session-authorization"
,
no_argument
,
&
dopt
.
use_setsessauth
,
1
},
{
"no-publications"
,
no_argument
,
&
dopt
.
no_publications
,
1
},
{
"no-security-labels"
,
no_argument
,
&
dopt
.
no_security_labels
,
1
},
{
"no-synchronized-snapshots"
,
no_argument
,
&
dopt
.
no_synchronized_snapshots
,
1
},
{
"no-unlogged-table-data"
,
no_argument
,
&
dopt
.
no_unlogged_table_data
,
1
},
...
...
@@ -862,6 +863,7 @@ main(int argc, char **argv)
ropt
->
use_setsessauth
=
dopt
.
use_setsessauth
;
ropt
->
disable_dollar_quoting
=
dopt
.
disable_dollar_quoting
;
ropt
->
dump_inserts
=
dopt
.
dump_inserts
;
ropt
->
no_publications
=
dopt
.
no_publications
;
ropt
->
no_security_labels
=
dopt
.
no_security_labels
;
ropt
->
no_subscriptions
=
dopt
.
no_subscriptions
;
ropt
->
lockWaitTimeout
=
dopt
.
lockWaitTimeout
;
...
...
@@ -951,6 +953,7 @@ help(const char *progname)
printf
(
_
(
" --exclude-table-data=TABLE do NOT dump data for the named table(s)
\n
"
));
printf
(
_
(
" --if-exists use IF EXISTS when dropping objects
\n
"
));
printf
(
_
(
" --inserts dump data as INSERT commands, rather than COPY
\n
"
));
printf
(
_
(
" --no-publications do not dump publications
\n
"
));
printf
(
_
(
" --no-security-labels do not dump security label assignments
\n
"
));
printf
(
_
(
" --no-subscriptions do not dump subscriptions
\n
"
));
printf
(
_
(
" --no-synchronized-snapshots do not use synchronized snapshots in parallel jobs
\n
"
));
...
...
@@ -3376,6 +3379,7 @@ dumpPolicy(Archive *fout, PolicyInfo *polinfo)
void
getPublications
(
Archive
*
fout
)
{
DumpOptions
*
dopt
=
fout
->
dopt
;
PQExpBuffer
query
;
PGresult
*
res
;
PublicationInfo
*
pubinfo
;
...
...
@@ -3390,7 +3394,7 @@ getPublications(Archive *fout)
int
i
,
ntups
;
if
(
fout
->
remoteVersion
<
100000
)
if
(
dopt
->
no_publications
||
fout
->
remoteVersion
<
100000
)
return
;
query
=
createPQExpBuffer
();
...
...
src/bin/pg_dump/pg_dumpall.c
View file @
96e1cb4c
...
...
@@ -74,6 +74,7 @@ static int if_exists = 0;
static
int
inserts
=
0
;
static
int
no_tablespaces
=
0
;
static
int
use_setsessauth
=
0
;
static
int
no_publications
=
0
;
static
int
no_security_labels
=
0
;
static
int
no_subscriptions
=
0
;
static
int
no_unlogged_table_data
=
0
;
...
...
@@ -129,6 +130,7 @@ main(int argc, char *argv[])
{
"quote-all-identifiers"
,
no_argument
,
&
quote_all_identifiers
,
1
},
{
"role"
,
required_argument
,
NULL
,
3
},
{
"use-set-session-authorization"
,
no_argument
,
&
use_setsessauth
,
1
},
{
"no-publications"
,
no_argument
,
&
no_publications
,
1
},
{
"no-security-labels"
,
no_argument
,
&
no_security_labels
,
1
},
{
"no-subscriptions"
,
no_argument
,
&
no_subscriptions
,
1
},
{
"no-sync"
,
no_argument
,
NULL
,
4
},
...
...
@@ -385,6 +387,8 @@ main(int argc, char *argv[])
appendPQExpBufferStr
(
pgdumpopts
,
" --quote-all-identifiers"
);
if
(
use_setsessauth
)
appendPQExpBufferStr
(
pgdumpopts
,
" --use-set-session-authorization"
);
if
(
no_publications
)
appendPQExpBufferStr
(
pgdumpopts
,
" --no-publications"
);
if
(
no_security_labels
)
appendPQExpBufferStr
(
pgdumpopts
,
" --no-security-labels"
);
if
(
no_subscriptions
)
...
...
@@ -594,6 +598,7 @@ help(void)
printf
(
_
(
" --disable-triggers disable triggers during data-only restore
\n
"
));
printf
(
_
(
" --if-exists use IF EXISTS when dropping objects
\n
"
));
printf
(
_
(
" --inserts dump data as INSERT commands, rather than COPY
\n
"
));
printf
(
_
(
" --no-publications do not dump publications
\n
"
));
printf
(
_
(
" --no-security-labels do not dump security label assignments
\n
"
));
printf
(
_
(
" --no-subscriptions do not dump subscriptions
\n
"
));
printf
(
_
(
" --no-sync do not wait for changes to be written safely to disk
\n
"
));
...
...
src/bin/pg_dump/pg_restore.c
View file @
96e1cb4c
...
...
@@ -71,6 +71,7 @@ main(int argc, char **argv)
static
int
no_data_for_failed_tables
=
0
;
static
int
outputNoTablespaces
=
0
;
static
int
use_setsessauth
=
0
;
static
int
no_publications
=
0
;
static
int
no_security_labels
=
0
;
static
int
no_subscriptions
=
0
;
static
int
strict_names
=
0
;
...
...
@@ -118,6 +119,7 @@ main(int argc, char **argv)
{
"section"
,
required_argument
,
NULL
,
3
},
{
"strict-names"
,
no_argument
,
&
strict_names
,
1
},
{
"use-set-session-authorization"
,
no_argument
,
&
use_setsessauth
,
1
},
{
"no-publications"
,
no_argument
,
&
no_publications
,
1
},
{
"no-security-labels"
,
no_argument
,
&
no_security_labels
,
1
},
{
"no-subscriptions"
,
no_argument
,
&
no_subscriptions
,
1
},
...
...
@@ -356,6 +358,7 @@ main(int argc, char **argv)
opts
->
noDataForFailedTables
=
no_data_for_failed_tables
;
opts
->
noTablespace
=
outputNoTablespaces
;
opts
->
use_setsessauth
=
use_setsessauth
;
opts
->
no_publications
=
no_publications
;
opts
->
no_security_labels
=
no_security_labels
;
opts
->
no_subscriptions
=
no_subscriptions
;
...
...
@@ -479,6 +482,7 @@ usage(const char *progname)
printf
(
_
(
" --if-exists use IF EXISTS when dropping objects
\n
"
));
printf
(
_
(
" --no-data-for-failed-tables do not restore data of tables that could not be
\n
"
" created
\n
"
));
printf
(
_
(
" --no-publications do not restore publications
\n
"
));
printf
(
_
(
" --no-security-labels do not restore security labels
\n
"
));
printf
(
_
(
" --no-subscriptions do not restore subscriptions
\n
"
));
printf
(
_
(
" --no-tablespaces do not restore tablespace assignments
\n
"
));
...
...
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