diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c index 36e3383b85..e4060124fb 100644 --- a/src/bin/pg_dump/pg_backup_archiver.c +++ b/src/bin/pg_dump/pg_backup_archiver.c @@ -2855,8 +2855,13 @@ _tocEntryRequired(TocEntry *te, teSection curSection, ArchiveHandle *AH) if (ropt->no_comments && strcmp(te->desc, "COMMENT") == 0) return 0; - /* If it's a publication, maybe ignore it */ - if (ropt->no_publications && strcmp(te->desc, "PUBLICATION") == 0) + /* + * If it's a publication or a table part of a publication, maybe ignore + * it. + */ + if (ropt->no_publications && + (strcmp(te->desc, "PUBLICATION") == 0 || + strcmp(te->desc, "PUBLICATION TABLE") == 0)) return 0; /* If it's a security label, maybe ignore it */ diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index e91184ba6e..b2a1e83e11 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -3886,6 +3886,7 @@ getPublicationTables(Archive *fout, TableInfo tblinfo[], int numTables) PQExpBuffer query; PGresult *res; PublicationRelInfo *pubrinfo; + DumpOptions *dopt = fout->dopt; int i_tableoid; int i_oid; int i_pubname; @@ -3893,7 +3894,7 @@ getPublicationTables(Archive *fout, TableInfo tblinfo[], int numTables) j, ntups; - if (fout->remoteVersion < 100000) + if (dopt->no_publications || fout->remoteVersion < 100000) return; query = createPQExpBuffer();