agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
pgsql: Fix logical decoding to ignore updates without a new tuple.
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix logical decoding to ignore updates without a new tuple.
@ 2026-09-11 17:55  Masahiko Sawada <msawada@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Masahiko Sawada @ 2026-09-11 17:55 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix logical decoding to ignore updates without a new tuple.

REPACK (CONCURRENTLY) suppresses logical decoding of the changes it
applies to the transient heap. For an update, suppression keeps the
tuple data out of the WAL record, but the record itself is still
written, and decoding turned it into a change carrying neither a new
nor an old tuple. An output plugin that asks for the changes made by
heap rewrites therefore outputs an UPDATE with no data at all,
reported under the name of the table being repacked.

Ignore such records, as decoding already does for inserts. Updates on
catalog relations don't carry the new tuple either, so we ignore them
too. For deletes, REPACK sets XLH_DELETE_NO_LOGICAL instead.

Backpatch to v19, where REPACK (CONCURRENTLY) was introduced.

Reported-by: Thom Brown <thom@linux.com>
Reviewed-by: Zhijie Hou (Fujitsu) <houzj.fnst@fujitsu.com>
Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de>
Discussion: https://postgr.es/m/CAA-aLv7L_-dOuHXjLh0Di66dExdOb=uTOzR=jtrqCmV0Wxyd2Q@mail.gmail.com
Backpatch-through: 19

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3a3524e9acf4b22e7b3100a3710be3adffe89874

Modified Files
--------------
src/backend/replication/logical/decode.c           |  9 ++++
.../injection_points/expected/repack_decode.out    | 48 +++++++++++++++++++++-
.../injection_points/specs/repack_decode.spec      | 25 +++++++++++
3 files changed, 81 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Fix logical decoding to ignore updates without a new tuple.
@ 2026-09-11 17:55  Masahiko Sawada <msawada@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Masahiko Sawada @ 2026-09-11 17:55 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix logical decoding to ignore updates without a new tuple.

REPACK (CONCURRENTLY) suppresses logical decoding of the changes it
applies to the transient heap. For an update, suppression keeps the
tuple data out of the WAL record, but the record itself is still
written, and decoding turned it into a change carrying neither a new
nor an old tuple. An output plugin that asks for the changes made by
heap rewrites therefore outputs an UPDATE with no data at all,
reported under the name of the table being repacked.

Ignore such records, as decoding already does for inserts. Updates on
catalog relations don't carry the new tuple either, so we ignore them
too. For deletes, REPACK sets XLH_DELETE_NO_LOGICAL instead.

Backpatch to v19, where REPACK (CONCURRENTLY) was introduced.

Reported-by: Thom Brown <thom@linux.com>
Reviewed-by: Zhijie Hou (Fujitsu) <houzj.fnst@fujitsu.com>
Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de>
Discussion: https://postgr.es/m/CAA-aLv7L_-dOuHXjLh0Di66dExdOb=uTOzR=jtrqCmV0Wxyd2Q@mail.gmail.com
Backpatch-through: 19

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7ed016a1de345ffac2d54979914c61617abae4ce

Modified Files
--------------
src/backend/replication/logical/decode.c           |  9 ++++
.../injection_points/expected/repack_decode.out    | 48 +++++++++++++++++++++-
.../injection_points/specs/repack_decode.spec      | 25 +++++++++++
3 files changed, 81 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2026-09-11 17:55 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-09-11 17:55 pgsql: Fix logical decoding to ignore updates without a new tuple. Masahiko Sawada <msawada@postgresql.org>
2026-09-11 17:55 pgsql: Fix logical decoding to ignore updates without a new tuple. Masahiko Sawada <msawada@postgresql.org>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox