postgresql/src/backend
Amit Kapila 52d5ea9adb 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
2022-06-21 08:03:30 +05:30
..
access Silence compiler warnings from some older compilers. 2022-06-01 17:21:45 -04:00
bootstrap Rethink definition of pg_attribute.attcompression. 2021-05-27 13:24:27 -04:00
catalog Make relation-enumerating operations be security-restricted operations. 2022-05-09 08:35:12 -07:00
commands Fix COPY FROM when database encoding is SQL_ASCII. 2022-05-29 23:57:16 +03:00
executor Un-break whole-row Vars referencing domain-over-composite types. 2022-06-10 10:35:57 -04:00
foreign Update copyright for 2021 2021-01-02 13:06:25 -05:00
jit Back-patch LLVM 14 API changes. 2022-03-16 11:42:00 +13:00
lib Fix typo in comment 2021-04-20 14:35:16 +02:00
libpq Remove misguided SSL key file ownership check in libpq. 2022-05-26 14:14:05 -04:00
main Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodes Fix assorted missing logic for GroupingFunc nodes. 2022-03-21 17:44:29 -04:00
optimizer Fix incorrect row estimates used for Memoize costing 2022-05-16 16:08:37 +12:00
parser Check column list length in XMLTABLE/JSON_TABLE alias 2022-05-18 20:28:31 +02:00
partitioning Avoid using ambiguous word "non-negative" in error messages. 2021-07-28 01:21:35 +09:00
po Translation updates 2022-06-13 07:32:39 +02:00
port Reject huge_pages=on if shared_memory_type=sysv. 2021-10-26 13:09:00 +13:00
postmaster Wake up for latches in CheckpointWriteDelay(). 2022-03-16 13:57:07 +13:00
regex Make pg_regexec() robust against out-of-range search_start. 2021-09-11 15:19:43 -04:00
replication Fix partition table's REPLICA IDENTITY checking on the subscriber. 2022-06-21 08:03:30 +05:30
rewrite Fix incautious CTE matching in rewriteSearchAndCycle(). 2022-04-23 12:16:12 -04:00
snowball Update snowball 2021-02-19 08:10:15 +01:00
statistics Build inherited extended stats on partitioned tables 2022-01-15 19:05:22 +01:00
storage Revert changes to CONCURRENTLY that "sped up" Xmin advance 2022-05-31 21:24:59 +02:00
tcop Fix DDL deparse of CREATE OPERATOR CLASS 2022-05-20 18:52:55 +02:00
tsearch Fix typos and grammar in comments and docs 2021-04-19 11:32:30 +09:00
utils Ensure ParseTzFile() closes the input file after failing. 2022-05-31 14:47:44 -04:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Use sort_template.h for qsort_tuple() and qsort_ssup(). 2021-03-03 17:02:32 +13:00
nls.mk Translation updates 2021-09-20 16:23:13 +02:00