mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +03:00
Fix assertion with relation using REPLICA IDENTITY FULL in subscriber
In a logical replication subscriber, a table using REPLICA IDENTITY FULL which has a primary key would try to use the primary key's index available to scan for a tuple, but an assertion only assumed as correct the case of an index associated to REPLICA IDENTITY USING INDEX. This commit corrects the assertion so as the use of a primary key index is a valid case. Reported-by: Dilip Kumar Analyzed-by: Dilip Kumar Author: Euler Taveira Reviewed-by: Michael Paquier, Masahiko Sawada Discussion: https://postgr.es/m/CAFiTN-u64S5bUiPL1q5kwpHNd0hRnf1OE-bzxNiOs5zo84i51w@mail.gmail.com Backpatch-through: 10
This commit is contained in:
@ -57,7 +57,8 @@ build_replindex_scan_key(ScanKey skey, Relation rel, Relation idxrel,
|
||||
int2vector *indkey = &idxrel->rd_index->indkey;
|
||||
bool hasnulls = false;
|
||||
|
||||
Assert(RelationGetReplicaIndex(rel) == RelationGetRelid(idxrel));
|
||||
Assert(RelationGetReplicaIndex(rel) == RelationGetRelid(idxrel) ||
|
||||
RelationGetPrimaryKeyIndex(rel) == RelationGetRelid(idxrel));
|
||||
|
||||
indclassDatum = SysCacheGetAttr(INDEXRELID, idxrel->rd_indextuple,
|
||||
Anum_pg_index_indclass, &isnull);
|
||||
|
Reference in New Issue
Block a user