aboutsummaryrefslogtreecommitdiff
path: root/src/backend/replication/pgoutput/pgoutput.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2018-02-23 21:17:57 -0500
committerPeter Eisentraut <peter_e@gmx.net>2018-02-23 22:09:26 -0500
commitb9bf23abb0e9a63ecc5f4b68a8229146291270e5 (patch)
treefd94021e07eae967dd3c21368703be4be261ba42 /src/backend/replication/pgoutput/pgoutput.c
parent0222e897d8dc063f92a3e2058ae301e14014a7c3 (diff)
downloadpostgresql-b9bf23abb0e9a63ecc5f4b68a8229146291270e5.tar.gz
postgresql-b9bf23abb0e9a63ecc5f4b68a8229146291270e5.zip
Fix filtering of unsupported relations in logical replication
In the pgoutput plugin, skip changes for relations that are not publishable, per is_publishable_class(). This concerns in particular materialized views and information_schema tables. While those relations cannot be part of a publication, per existing checks, they will be considered by a FOR ALL TABLES publication. A subscription would not actually apply changes for those relations, again per existing checks, but trying to match incoming changes to local tables on the subscriber would lead to errors if no matching local table exists. Skipping those changes on the publisher avoids sending useless changes and eliminates the error. Bug: #15044 Reported-by: Chad Trabant <chad@iris.washington.edu> Reviewed-by: Petr Jelinek <petr.jelinek@2ndquadrant.com>
Diffstat (limited to 'src/backend/replication/pgoutput/pgoutput.c')
-rw-r--r--src/backend/replication/pgoutput/pgoutput.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/backend/replication/pgoutput/pgoutput.c b/src/backend/replication/pgoutput/pgoutput.c
index 61e53aba193..38b0eab7d2e 100644
--- a/src/backend/replication/pgoutput/pgoutput.c
+++ b/src/backend/replication/pgoutput/pgoutput.c
@@ -264,6 +264,9 @@ pgoutput_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
MemoryContext old;
RelationSyncEntry *relentry;
+ if (!is_publishable_relation(relation))
+ return;
+
relentry = get_rel_sync_entry(data, RelationGetRelid(relation));
/* First check the table filter */