Re: Dropped and generated columns might cause wrong data on subs when REPLICA IDENTITY FULL
Önder Kalacı <onderkalaci@gmail.com>
From: Önder Kalacı <onderkalaci@gmail.com>
To: "shiy.fnst@fujitsu.com" <shiy.fnst@fujitsu.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-03-21T12:02:58Z
Lists: pgsql-hackers
Attachments
- v1-0001-REL_12-Ignore-generated-columns-during-apply-of-update-d.patch (application/octet-stream) patch v1-0001
- v1-0001-REL_15-Ignore-generated-columns-during-apply-of-update-d.patch (application/octet-stream) patch v1-0001
- v1-0001-REL_14-REL_13-Ignore-generated-columns-during-apply-of-update-d.patch (application/octet-stream) patch v1-0001
- v1-0001-HEAD-Ignore-generated-columns-during-apply-of-update-d.patch (application/octet-stream) patch v1-0001
Hi Shi Yu, > > > 1. > $node_publisher->safe_psql( > 'postgres', qq( > ALTER TABLE dropped_cols DROP COLUMN b_drop; > + ALTER TABLE generated_cols DROP COLUMN b_gen; > )); > $node_subscriber->safe_psql( > 'postgres', qq( > ALTER TABLE dropped_cols DROP COLUMN b_drop; > + ALTER TABLE generated_cols DROP COLUMN b_gen; > )); > > I think we want to test generated columns, so we don't need to drop > columns. > Otherwise the generated column problem can't be detected. > > Ow, what a mistake. Now changed (and ensured that without the patch the test fails). > 2. > # The bug was that when the REPLICA IDENTITY FULL is used with dropped > columns, > # we fail to apply updates and deletes > > Maybe we should mention generated columns in comment of the test. > > makes sense > 3. > I ran pgindent and it modified some lines. Maybe we can improve the patch > as the following. > > @@ -292,8 +292,8 @@ tuples_equal(TupleTableSlot *slot1, TupleTableSlot > *slot2, > att = TupleDescAttr(slot1->tts_tupleDescriptor, attrnum); > > /* > - * Ignore dropped and generated columns as the publisher > - * doesn't send those > + * Ignore dropped and generated columns as the publisher > doesn't send > + * those > */ > if (att->attisdropped || att->attgenerated) > continue; > > fixed Attached patches again. Thanks, Onder KALACI
Commits
-
Ignore generated columns during apply of update/delete.
- adedf54e659e 16.0 landed
- b6bf90edcd2f 15.3 landed
- 9dac02c77258 14.8 landed
- be52fff91dc9 13.11 landed
- 0f2d4adbf85f 12.15 landed
-
Ignore dropped columns during apply of update/delete.
- b797def5951f 16.0 landed
- 3c12407f4cf7 15.3 landed
- 65ead76961a4 14.8 landed
- 751d6676daf3 13.11 landed
- fc63e6ba8670 12.15 landed
- 4cdaea7a2119 11.20 landed