Skip to content

Commit 08c9917

Browse files
committed
Ignore publication tables when --no-publications is used
96e1cb4 has added support for --no-publications in pg_dump, pg_dumpall and pg_restore, but forgot the fact that publication tables also need to be ignored when this option is used. Author: Gilles Darold Reviewed-by: Michael Paquier Discussion: https://postgr.es/m/3f48e812-b0fa-388e-2043-9a176bdee27e@dalibo.com Backpatch-through: 10, where publications have been added.
1 parent edb9797 commit 08c9917

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
@@ -2919,8 +2919,13 @@ _tocEntryRequired(TocEntry *te, teSection curSection, ArchiveHandle *AH)
29192919
if (ropt->no_comments && strcmp(te->desc, "COMMENT") == 0)
29202920
return 0;
29212921

2922-
/* If it's a publication, maybe ignore it */
2923-
if (ropt->no_publications && strcmp(te->desc, "PUBLICATION") == 0)
2922+
/*
2923+
* If it's a publication or a table part of a publication, maybe ignore
2924+
* it.
2925+
*/
2926+
if (ropt->no_publications &&
2927+
(strcmp(te->desc, "PUBLICATION") == 0 ||
2928+
strcmp(te->desc, "PUBLICATION TABLE") == 0))
29242929
return 0;
29252930

29262931
/* 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
@@ -3907,14 +3907,15 @@ getPublicationTables(Archive *fout, TableInfo tblinfo[], int numTables)
39073907
PQExpBuffer query;
39083908
PGresult *res;
39093909
PublicationRelInfo *pubrinfo;
3910+
DumpOptions *dopt = fout->dopt;
39103911
int i_tableoid;
39113912
int i_oid;
39123913
int i_pubname;
39133914
int i,
39143915
j,
39153916
ntups;
39163917

3917-
if (fout->remoteVersion < 100000)
3918+
if (dopt->no_publications || fout->remoteVersion < 100000)
39183919
return;
39193920

39203921
query = createPQExpBuffer();

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy