aboutsummaryrefslogtreecommitdiff
path: root/src/backend/replication/logical/tablesync.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2020-03-10 08:42:59 +0100
committerPeter Eisentraut <peter@eisentraut.org>2020-03-10 09:09:32 +0100
commit17b9e7f9fe238eeb5f6b40061b444ebf28d9e06f (patch)
tree7c6f8d87b72708aeeb5f800ec6384cc19c927b63 /src/backend/replication/logical/tablesync.c
parent61d7c7bce3686ec02bd64abac742dd35ed9b9b01 (diff)
downloadpostgresql-17b9e7f9fe238eeb5f6b40061b444ebf28d9e06f.tar.gz
postgresql-17b9e7f9fe238eeb5f6b40061b444ebf28d9e06f.zip
Support adding partitioned tables to publication
When a partitioned table is added to a publication, changes of all of its partitions (current or future) are published via that publication. This change only affects which tables a publication considers as its members. The receiving side still sees the data coming from the individual leaf partitions. So existing restrictions that partition hierarchies can only be replicated one-to-one are not changed by this. Author: Amit Langote <amitlangote09@gmail.com> Reviewed-by: Rafia Sabih <rafia.pghackers@gmail.com> Reviewed-by: Peter Eisentraut <peter.eisentraut@2ndquadrant.com> Discussion: https://www.postgresql.org/message-id/flat/CA+HiwqH=Y85vRK3mOdjEkqFK+E=ST=eQiHdpj43L=_eJMOOznQ@mail.gmail.com
Diffstat (limited to 'src/backend/replication/logical/tablesync.c')
-rw-r--r--src/backend/replication/logical/tablesync.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/backend/replication/logical/tablesync.c b/src/backend/replication/logical/tablesync.c
index f8183cd488c..98825f01e98 100644
--- a/src/backend/replication/logical/tablesync.c
+++ b/src/backend/replication/logical/tablesync.c
@@ -761,6 +761,7 @@ copy_table(Relation rel)
/* Map the publisher relation to local one. */
relmapentry = logicalrep_rel_open(lrel.remoteid, NoLock);
Assert(rel == relmapentry->localrel);
+ Assert(relmapentry->localrel->rd_rel->relkind == RELKIND_RELATION);
/* Start copy on the publisher. */
initStringInfo(&cmd);