v68_changes_amit_1.patch
application/octet-stream
Filename: v68_changes_amit_1.patch
Type: application/octet-stream
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
Series: patch v68
| File | + | − |
|---|---|---|
| src/backend/commands/publicationcmds.c | 3 | 0 |
| src/backend/replication/pgoutput/pgoutput.c | 4 | 2 |
diff --git a/src/backend/commands/publicationcmds.c b/src/backend/commands/publicationcmds.c
index 7574a628ef..579a510c51 100644
--- a/src/backend/commands/publicationcmds.c
+++ b/src/backend/commands/publicationcmds.c
@@ -328,6 +328,9 @@ contain_invalid_rfcolumn(Oid pubid, Relation relation, List *ancestors,
* For a partition, if pubviaroot is true, find the topmost
* ancestor that is published via this publication as we need to
* use its row filter expression to filter the partition's changes.
+ *
+ * Note that even though the row filter used is for an ancestor, the
+ * Replica Identity used will be for the actual child table.
*/
if (pub->pubviaroot && relation->rd_rel->relispartition)
{
diff --git a/src/backend/replication/pgoutput/pgoutput.c b/src/backend/replication/pgoutput/pgoutput.c
index 4d0632fc86..b2c96e9244 100644
--- a/src/backend/replication/pgoutput/pgoutput.c
+++ b/src/backend/replication/pgoutput/pgoutput.c
@@ -1116,9 +1116,11 @@ pgoutput_row_filter(Relation relation, TupleTableSlot *old_slot,
}
/*
- * For updates, if both the new tuple and old tuple are not null, then both
- * of them need to be checked against the row filter.
+ * Both the old and new tuples must be valid only for updates and need to
+ * be checked against the row filter.
*/
+ Assert(map_changetype_pubaction[*action] == PUBACTION_UPDATE);
+
tmp_new_slot = new_slot;
slot_getallattrs(new_slot);
slot_getallattrs(old_slot);