PostgreSQL logical replication with partitioned tables

This post explains how publish_via_partition_root changes the logical replication behavior of partitioned tables in PostgreSQL. When a row is inserted into a partitioned table, it is stored in one of its leaf partitions. For logical replication, PostgreSQL must decide which table identity will be sent to the subscriber: the partitioned root table or the leaf partition. This behavior is controlled…