Skip to content

Commit 3326678

Browse files
danolivoarssher
authored andcommitted
[PGPRO-4074] Skip equality check of dropped column during apply process.
Replication worker don't send dropped attribute (attisdropped == true) to a replica. But in the heap it may be not null. If we apply UPDATE operation in the REPLICA IDENTITY FULL mode, we will do SeqScan on the table and check equality of each attribute of each tuple. Tuple in the heap will have value of attr->isnull == false, tuple that passed from another node - true. (cherry picked from commit 8d4c732f0e653ae6c65b4764f7de4f31456284ff) tags: multimaster (cherry picked from commit 2825fa678e82ba0fd6888bacc95f2b112401a46c)
1 parent 9ed770f commit 3326678

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/backend/executor/execReplication.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,15 @@ tuples_equal(TupleTableSlot *slot1, TupleTableSlot *slot2,
244244
Form_pg_attribute att;
245245
TypeCacheEntry *typentry;
246246

247+
/* The case of ALTER TABLE ... DROP COLUMN */
248+
if (TupleDescAttr(slot1->tts_tupleDescriptor, attrnum)->attisdropped ||
249+
TupleDescAttr(slot1->tts_tupleDescriptor, attrnum)->attgenerated)
250+
{
251+
Assert(slot1->tts_tupleDescriptor->attrs[attrnum].attisdropped ==
252+
slot2->tts_tupleDescriptor->attrs[attrnum].attisdropped);
253+
continue;
254+
}
255+
247256
/*
248257
* If one value is NULL and other is not, then they are certainly not
249258
* equal

0 commit comments

Comments
 (0)