Waiting for PostgreSQL 13 – Add logical replication support to replicate into partitioned tables

On 6th of April 2020, Peter Eisentraut committed patch:

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

Lifting a limitation in one of replication schemas is hardly sexy. But this is something that sounds very interesting, if only that it will allow for very fast switching to partitioned schema.

Instead of migrating things table by table, in many steps, using method like the one I described year ago, you will be able to setup copy of database, with partitioned tables, updated automatically via replication, and then just switch to new database. Which should be much simpler to handle downtime-wise.

Setting full example seems trivial, and I already described it, so I guess I'll skip it for now.

In any way – this sounds amazing, thanks to all involved.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.