Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1f50394

Browse files
committed
Ignore publication tables when --no-publications is used
96e1cb4 has added support for --no-publications in pg_dump, pg_dumpalland pg_restore, but forgot the fact that publication tables also need tobe ignored when this option is used.Author: Gilles DaroldReviewed-by: Michael PaquierDiscussion:https://postgr.es/m/3f48e812-b0fa-388e-2043-9a176bdee27e@dalibo.comBackpatch-through: 10, where publications have been added.
1 parenta3bb831 commit1f50394

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

‎src/bin/pg_dump/pg_backup_archiver.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2855,8 +2855,13 @@ _tocEntryRequired(TocEntry *te, teSection curSection, ArchiveHandle *AH)
28552855
if (ropt->no_comments&&strcmp(te->desc,"COMMENT")==0)
28562856
return0;
28572857

2858-
/* If it's a publication, maybe ignore it */
2859-
if (ropt->no_publications&&strcmp(te->desc,"PUBLICATION")==0)
2858+
/*
2859+
* If it's a publication or a table part of a publication, maybe ignore
2860+
* it.
2861+
*/
2862+
if (ropt->no_publications&&
2863+
(strcmp(te->desc,"PUBLICATION")==0||
2864+
strcmp(te->desc,"PUBLICATION TABLE")==0))
28602865
return0;
28612866

28622867
/* If it's a security label, maybe ignore it */

‎src/bin/pg_dump/pg_dump.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3886,14 +3886,15 @@ getPublicationTables(Archive *fout, TableInfo tblinfo[], int numTables)
38863886
PQExpBuffer query;
38873887
PGresult *res;
38883888
PublicationRelInfo *pubrinfo;
3889+
DumpOptions *dopt = fout->dopt;
38893890
inti_tableoid;
38903891
inti_oid;
38913892
inti_pubname;
38923893
inti,
38933894
j,
38943895
ntups;
38953896

3896-
if (fout->remoteVersion < 100000)
3897+
if (dopt->no_publications ||fout->remoteVersion < 100000)
38973898
return;
38983899

38993900
query = createPQExpBuffer();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp