1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Add logical replication support to replicate into partitioned tables

Mainly, this adds support code in logical/worker.c for applying
replicated operations whose target is a partitioned table to its
relevant partitions.

Author: Amit Langote <amitlangote09@gmail.com>
Reviewed-by: Rafia Sabih <rafia.pghackers@gmail.com>
Reviewed-by: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Reviewed-by: Petr Jelinek <petr@2ndquadrant.com>
Discussion: https://www.postgresql.org/message-id/flat/CA+HiwqH=Y85vRK3mOdjEkqFK+E=ST=eQiHdpj43L=_eJMOOznQ@mail.gmail.com
This commit is contained in:
Peter Eisentraut
2020-04-06 15:15:52 +02:00
parent b7ce6de93b
commit f1ac27bfda
7 changed files with 645 additions and 78 deletions

View File

@ -402,18 +402,21 @@
<listitem>
<para>
Replication is only supported by tables, partitioned or not, although a
given table must either be partitioned on both servers or not partitioned
at all. Also, when replicating between partitioned tables, the actual
replication occurs between leaf partitions, so partitions on the two
servers must match one-to-one.
</para>
<para>
Replication is only supported by tables, including partitioned tables.
Attempts to replicate other types of relations such as views, materialized
views, or foreign tables, will result in an error.
</para>
</listitem>
<listitem>
<para>
When replicating between partitioned tables, the actual replication
originates from the leaf partitions on the publisher, so partitions on
the publisher must also exist on the subscriber as valid target tables.
(They could either be leaf partitions themselves, or they could be
further subpartitioned, or they could even be independent tables.)
</para>
</listitem>
</itemizedlist>
</sect1>