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.
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 */
PQExpBuffer query;
PGresult *res;
PublicationRelInfo *pubrinfo;
+ DumpOptions *dopt = fout->dopt;
int i_tableoid;
int i_oid;
int i_pubname;
j,
ntups;
- if (fout->remoteVersion < 100000)
+ if (dopt->no_publications || fout->remoteVersion < 100000)
return;
query = createPQExpBuffer();