From: | Amit Kapila <akapila(at)postgresql(dot)org> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Fix partition table's REPLICA IDENTITY checking on the subscribe |
Date: | 2022-06-21 02:50:13 |
Message-ID: | E1o3Ty1-00133T-5p@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Fix partition table's REPLICA IDENTITY checking on the subscriber.
In logical replication, we will check if the target table on the
subscriber is updatable by comparing the replica identity of the table on
the publisher with the table on the subscriber. When the target table is a
partitioned table, we only check its replica identity but not for the
partition tables. This leads to assertion failure while applying changes
for update/delete as we expect those to succeed only when the
corresponding partition table has a primary key or has a replica
identity defined.
Fix it by checking the replica identity of the partition table while
applying changes.
Reported-by: Shi Yu
Author: Shi Yu, Hou Zhijie
Reviewed-by: Amit Langote, Amit Kapila
Backpatch-through: 13, where it was introduced
Discussion: https://postgr.es/m/OSZPR01MB6310F46CD425A967E4AEF736FDA49@OSZPR01MB6310.jpnprd01.prod.outlook.com
Branch
------
REL_14_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/52d5ea9adb010d0908e8962842571cd1f6c2d66c
Modified Files
--------------
src/backend/replication/logical/relation.c | 115 +++++++++++++++++------------
src/backend/replication/logical/worker.c | 27 +++++--
src/test/subscription/t/013_partition.pl | 16 +++-
3 files changed, 102 insertions(+), 56 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2022-06-21 04:12:04 | Re: pgsql: Fix partition table's REPLICA IDENTITY checking on the subscribe |
Previous Message | Peter Eisentraut | 2022-06-20 12:36:49 | pgsql: Fix file references inside some SGML comments |