Logical decoding
Decoding WAL into logical change streams through output plugins, with the reorder buffer, historic snapshots, logical messages and the SQL decoding interface. Introduced in PostgreSQL 9.4.
Versions
- PostgreSQL 20 · in-development · improved · minor · 1 commit · +97 / -0 lines
- PostgreSQL 19 · shipped · improved · minor · 2 commits · +30 / -9 lines
- PostgreSQL 18 · shipped · new · moderate · 3 commits · +826 / -252 lines
- PostgreSQL 17 · reverted · improved · moderate · 5 commits · +555 / -249 lines
- PostgreSQL 16 · worked-on · improved · moderate
- PostgreSQL 14 · worked-on · improved · minor
Threads
- Why is the LSN reported for pg_logical_emit_message() different from other decoded operations?
- BUG #18754: Logical replication cannot restart if client sent a copyDone
- Bug in logical decoding with DDL and subtransactions
- Re: Bug in logical decoding with DDL and subtransactions
- Historic snapshot doesn't track txns committed in BUILDING_SNAPSHOT state
- BUG #19839: Assert in ReorderBufferRestoreCleanup for aborted, spilled transaction
- [PATCH] Add a check_hook for output_plugin_libraries
- logical decoding: skip unnecessary snapshot distribution.
- BUG #19733: Row not visible to a new snapshot after its transactional logical decoding message has been streamed
- [PATCH] Clear walsender reader pointers after cleanup
- Race conditions in logical decoding
- xact_rollback spikes when logical walsender exits
- Misplaced comment in snapbuild.c
- Lazy snapshot distribution in logical decoding
- [BUG] Incorrect historic snapshot may be serialized to disk during fast-forwarding
- Report bytes and transactions actually sent downtream
- Fix a relcache reference leak in reorderbuffer.c
- 030_pg_recvlogical fails because the same PID is assigned
- BUG #19555: TRAP: failed Assert (ent->cmin == change->data.tuplecid.cmin) on logical replication
- pg_recvlogical: send final feedback on SIGINT/SIGTERM exit
- Add logical_decoding_spill_limit to cap spill file disk usage per slot
- [BUG] Assert failure in ReorderBufferReturnTXN during logical decoding due to leaked specinsert change
- Optimize RelfilenumberMapInvalidateCallback for logical decoding performance
- pg_recvlogical: honor source cluster file permissions for output files
- Possible premature SNAPBUILD_CONSISTENT with DB-specific running_xacts
- Inconsistent increment of pg_stat_database.xact_rollback with logical replication
- subscriptionCheck failures on nightjar
- pgsql: Reduce log level of some logical decoding messages from LOG to D
- Optimize SnapBuild by maintaining committed.xip in sorted order
- Reduce log level of some logical decoding messages to DEBUG1
- [PATCH] Remove unused is_error parameter from TeardownHistoricSnapshot()
- Dead code in logical decoding of speculative insertions
- Fix logical decoding not track transaction during SNAPBUILD_BUILDING_SNAPSHOT
- Optimize SnapBuildPurgeOlderTxn: use in-place compaction instead of temporary array
- pg_recvlogical: Prevent flushed data from being re-sent after restarting replication
- Optimize SnapBuildPurgeOlderTxn to purge committed xids in-place
- Assertion failure in SnapBuildInitialSnapshot()
- [PATCH] Add missing XLogEnsureRecordSpace() call in LogLogicalMessage
- making tid and HOTness of UPDATE available to logical decoding plugins
- BUG #19109: catalog lookup with the wrong snapshot during logical decoding causes coredump
- minor improvement in snapbuild: use existing interface and remove fake code
- Document default values for --fsync-interval and --plugin in pg_recvlogical
- [PATCH] Implement condition variable-based WAL waiting for logical decoding
- Add memory_limit_hits to pg_stat_replication_slots
- Report reorder buffer size
- Add progressive backoff to XactLockTableWait functions
- BUG #19029: Replication Slot size keeps increasing while logical subscription works fine
- Use-after-free in reorderbuffer.c for INSERT ON CONFLICT
- Document reopen of output file via SIGHUP in pg_recvlogical
- pg_logical_slot_get_changes waits continously for a partial WAL record spanning across 2 pages
- Logical replication 'invalid memory alloc request size 1585837200' after upgrading to 17.5
- Logical replication 'ERROR: invalid memory alloc request size 1831213792' after upgrading to 15.13
- BUG #18509: Logical decoding behaves badly when processing a change record for a table with altered column
- Memory allocation error DDL invalidation (seen with 15.13 & 16.9)
- BUG #18942: walsender memory allocation failure adding snapshot and invalidations to logical replica w/PG 16.9
- BUG #18938: Logical replication failure in 16.9: "invalid memory alloc request size 1372786672"
- Add new wait event to XactLockTableWait
- Add CHECK_FOR_INTERRUPTS in polling loop code path in XactLockTableWait
- BUG #17695: Failed Assert in logical replication snapbuild.
- Fix premature xmin advancement during fast forward decoding
- Memory context can be its own parent and child in replication command
- Some codes refer slot()->{'slot_name'} but it is not defined
- Add missing PQclear for StreamLogicalLog function
- Add contrib/pg_logicalsnapinspect
- BUG #18828: Crash when pg_get_logical_snapshot_meta() passed empty string
- Rename functions to alloc/free things in reorderbuffer.c
- Reset the output buffer after sending from WalSndWriteData
- Is it possible to make ReorderBufferRestoreCleanup faster?
- unused-but-set-variable warning on REL_13_STABLE
- Fix comment in reorderbuffer.h
- Compress ReorderBuffer spill files using LZ4
- Logical Replica ReorderBuffer Size Accounting Issues
- Using per-transaction memory contexts for storing decoded tuples
- Remove obsolete comment in reorderbuffer.h
- BUG #18638: PANIC: could not open file "pg_logical/snapshots/B6-9EE5B820.snap": Permission denied
- Regarding canditate_restart_lsn in logical decoding.
- Fix memory counter update in reorderbuffer
- rare crash - FailedAssertion snapbuild.c Line: 580
- Make reorder buffer max_changes_in_memory adjustable?
- Potential data loss due to race condition during logical replication slot creation
- BUG #18369: logical decoding core on AssertTXNLsnOrder()
- walsender.c comment with no context is hard to understand
- BUG #18486: Is there something wrong with the calculation in ReorderBufferChangeSize()?
- Format the code in xact_decode
- Improve eviction algorithm in ReorderBuffer
- Walsender getting klilled, ERROR: out of memory in server logs
- Bug report and fix about building historic snapshot
- BUG #18280: logical decoding build wrong snapshot for subtransactions
- Remove unused fields in ReorderBufferTupleBuf
- logical decoding build wrong snapshot with subtransactions
- [pg16]Question about building snapshot in logical decoding
- Error "initial slot snapshot too large" in create replication slot
- Re: Rework LogicalOutputPluginWriterUpdateProgress
- Unnecessary confirm work on logical replication
- [very minor] Documentation suggestion
- 48.1. Logical Decoding Examples
- pg_logical_emit_message() misses a XLogFlush()
- Included xid in restoring reorder buffer changes from disk log message
- BUG #18055: logical decoding core on AllocateSnapshotBuilder()
- logical decoding issue with concurrent ALTER TYPE
- pg_recvlogical prints bogus error when interrupted
- pg_decode_message vs skip_empty_xacts and xact_wrote_changes
- Backend handling replication slot stuck using 100% cpu, unkillable
- Optimize walsender handling invalid messages of 'drop publication'
- BUG #17989: ERROR: could not open file "pg_logical/snapshots/6-1E182808.snap": Permission denied
- BUG #17974: Walsenders memory usage suddenly spike to 80G+ causing OOM and server reboot
- TRAP: FailedAssertion("prev_first_lsn < cur_txn->first_lsn", File: "reorderbuffer.c", Line: 927, PID: 568639)
- BUG #17914: walsenders taking up all memory
- server log inflates due to pg_logical_slot_peek_changes/pg_logical_slot_get_changes calls
- Add macros for ReorderBufferTXN toptxn
- Adjust the description of OutputPluginCallbacks in pg-doc
- Question about initial logical decoding snapshot
- Segfault while creating logical replication slots on active DB 14.6-1 + 15.1-1
- BUG #17716: walsender process hang while decoding 'DROP PUBLICATION' XLOG
- Avoid distributing new catalog snapshot again for the transaction being decoded.
- Fix comment in SnapBuildFindSnapshot
- [BUG] FailedAssertion in SnapBuildPurgeOlderTxn
- [BUG] Logical replication failure "ERROR: could not map filenode "base/13237/442428" to relation OID" with catalog modifying txns
- Fix comments atop ReorderBufferAddInvalidations
- Logical WAL sender unresponsive during decoding commit
- test_decoding assertion failure for the loss of top-sub transaction relationship
- add checkpoint stats of snapshot and mapping files of pg_logical dir
- Avoid erroring out when unable to remove or parse logical rewrite files to save checkpoint work
- BUG #17580: use pg_terminate_backend to terminate a wal sender process may wait a long time
- bogus assert in logicalmsg_desc
- FailedAssertion("prev_first_lsn < cur_txn->first_lsn", File: "reorderbuffer.c", Line: 1173, ...
- relation OID in ReorderBufferToastReplace error message
- Question about building an exportable snapshop
- Reset snapshot export state on the transaction abort
- sentPtr jumping back at the beginning of logical replication
- Remove an obsolete comment in snapbuild.c
- Diagnostic comment in LogicalIncreaseXminForSlot
- [BUG] Failed Assertion in ReorderBufferChangeMemoryUpdate()
- [bug] Logical Decoding of relation rewrite with toast does not reset toast_hash
- data corruption hazard in reorderbuffer.c
- RFC: Detailed reorder buffer stats dumps
- Decoding speculative insert with toast leaks memory
- Question about StartLogicalReplication() error path
- Forget close an open relation in ReorderBufferProcessTXN()
- Replication slot used in logical decoding of documental database give error: got sequence entry 258 for toast chunk 538757697 instead of seq 0
- Any objections to implementing LogicalDecodeMessageCB for pgoutput?
- Logical replication failure "ERROR: could not map filenode "base/13237/442428" to relation OID" with catalog modifying txns
- [PATCH] Present all committed transaction to the output plugin
- Snapbuild woes followup
- BUG #16812: Logical decoding error
- SnapBuildSerialize function forgot pfree variable ondisk_c
- Logical decoding without slots: decoding in lockstep with recovery
- Logical archiving
- Remove incorrect assertion in reorderbuffer.c.
- Print logical WAL message content
- Local visibility with logical decoding
- BUG #16517: Fast Shutdown sometimes is not working if we use logical decoding.
- BUG #16327: Too many files in pg_replslot folder
- Fastpath while arranging the changes in LSN order in logical decoding
- ERROR: subtransaction logged without previous top-level txn record
- logical decoding : exceeded maxAllocatedDescs for .spill files
- Duplicated LSN in ReorderBuffer
- Reorderbuffer crash during recovery
- [PATCH] fix a performance issue with multiple logical-decoding walsenders
- Too rigorous assert in reorderbuffer.c
- [PATCH] Race condition in logical walsender causes long postgresql shutdown delay
- BUG #15929: logical decoding can not write down the analyse result when the output file is touched.
- BUG #15808: ERROR: subtransaction logged without previous top-level txn record (SQLSTATE XX000)
- Assertion for logically decoding multi inserts into the catalog
- BUG #15888: Bogus "idle in transaction" state for logical decoding client after creating a slot
- Reviving the "Stopping logical replication protocol" patch from Vladimir Gordichuk
- Built-in plugin for logical decoding output
- Patch: doc for pg_logical_emit_message()
- BUG #15778: Replication slot peak query cause memory spike at the server when big transaction are running
- Accidental setting of XLogReaderState.private_data ?
- BUG #15744: Replication slot peak query throwing error for wrong sequence entry for toast chunk
- [PG 9.6]make is failing for test_decoding contrib module.
- Server Crash in logical decoding if used inside --single mode
- Segmentation Fault in logical decoding get/peek API
- Incorrect visibility test function assigned to snapshot
- BUG #15633: Data loss when reading the data from logical replication slot
- Data loss when reading the data from logical replication slot
- BUG #15114: logical decoding Segmentation fault
- BUG #15594: Unstable tests in contrib/test_decoding/output_iso/
- reorderbuffer: memory overconsumption with medium-size subxacts
- logical decoding vs. VACUUM FULL / CLUSTER on table with TOAST-ed data
- logical decoding bug when mapped relation with toast contents is rewritten repeatedly
- Upper limit arguments of pg_logical_slot_xxx_changes functions accept invalid values
- PostgreSQL logical decoder output plugin - unchanged toast data
- memory leak when serializing TRUNCATE in reorderbuffer
- logical decoding: ABI break in 10.5 et al
- Some pgq table rewrite incompatibility with logical decoding?
- rare crash - FailedAssertion snapbuild.c Line: 580
- logical decoding / rewrite map vs. maxAllocatedDescs
- pgsql: Fix "base" snapshot handling in logical decoding
- Fix slot's xmin advancement and subxact's lost snapshots in decoding.
- crash while decoding INSERT ON CONFLICT
- pg_recvlogical broken in back branches
- handling of heap rewrites in logical decoding
- BUG #15116: pg_recvlogical always fails
- Two-phase update of restart_lsn in LogicalConfirmReceivedLocation
- BUGFIX: standby disconnect can corrupt serialized reorder buffers
- Too much memory allocated for ReorderBufferDiskChange
- Why chain of snapshots is used in ReorderBufferCommit?
- Logical Decoding and HeapTupleSatisfiesVacuum assumptions
- Failed to delete old ReorderBuffer spilled files
- Walsender timeouts and large transactions
- Patch: add --if-exists to pg_recvlogical
- Issue with logical replication: MyPgXact->xmin already is valid
- pg_logical_slot_peek_changes crashes postgres when called from inside pl/pgsql
- Logical Replication - test_decoding - unchanged-toast-datum
- pgjdbc logical replication client throwing exception
- error-handling in ReorderBufferCommit() seems somewhat broken
- BUG #14771: "Logical decoding" does not cover the impact of "TRUNCATE TABLE" command
- snapbuild woes
- Postgresql “alter column type” creates an event which contains “temp_table_xxx”
- Directory pg_replslot is not properly cleaned
- Too many files in pg_replslot folder
- Use of snapshot in logical replication
- wal_level > WAL_LEVEL_LOGICAL
- Improve logical decoding error message (was wal_level > WAL_LEVEL_LOGICAL)
- Proposal: Generic WAL logical messages