Logical decoding of TRUNCATE Add a new WAL record type for TRUNCATE, which is only used when wal_level >= logical. (For physical replication, TRUNCATE is already replicated via SMGR records.) Add new callback for logical decoding output plugins to receive TRUNCATE actions.
Author: Simon Riggs <si...@2ndquadrant.com> Author: Marco Nenciarini <marco.nenciar...@2ndquadrant.it> Author: Peter Eisentraut <peter.eisentr...@2ndquadrant.com> Reviewed-by: Petr Jelinek <petr.jeli...@2ndquadrant.com> Reviewed-by: Andres Freund <and...@anarazel.de> Reviewed-by: Alvaro Herrera <alvhe...@alvh.no-ip.org> Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/5dfd1e5a6696b271a2cdee54143fbc209c88c02f Modified Files -------------- contrib/test_decoding/Makefile | 2 +- contrib/test_decoding/expected/truncate.out | 25 ++++++ contrib/test_decoding/sql/truncate.sql | 10 +++ contrib/test_decoding/test_decoding.c | 58 +++++++++++++ doc/src/sgml/logicaldecoding.sgml | 27 +++++- src/backend/access/heap/heapam.c | 7 ++ src/backend/access/rmgrdesc/heapdesc.c | 16 ++++ src/backend/commands/tablecmds.c | 104 ++++++++++++++++++++++-- src/backend/replication/logical/decode.c | 41 ++++++++++ src/backend/replication/logical/logical.c | 43 ++++++++++ src/backend/replication/logical/reorderbuffer.c | 35 ++++++++ src/include/access/heapam_xlog.h | 23 +++++- src/include/commands/tablecmds.h | 2 + src/include/replication/output_plugin.h | 10 +++ src/include/replication/reorderbuffer.h | 24 +++++- 15 files changed, 414 insertions(+), 13 deletions(-)