Logical decoding of TRUNCATE
Peter Eisentraut <peter_e@gmx.net>
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 <simon@2ndquadrant.com> Author: Marco Nenciarini <marco.nenciarini@2ndquadrant.it> Author: Peter Eisentraut <peter.eisentraut@2ndquadrant.com> Reviewed-by: Petr Jelinek <petr.jelinek@2ndquadrant.com> Reviewed-by: Andres Freund <andres@anarazel.de> Reviewed-by: Alvaro Herrera <alvherre@alvh.no-ip.org>
Files
| Path | Change | +/− |
|---|---|---|
| contrib/test_decoding/expected/truncate.out | added | +25 −0 |
| contrib/test_decoding/Makefile | modified | +1 −1 |
| contrib/test_decoding/sql/truncate.sql | added | +10 −0 |
| contrib/test_decoding/test_decoding.c | modified | +58 −0 |
| doc/src/sgml/logicaldecoding.sgml | modified | +26 −1 |
| src/backend/access/heap/heapam.c | modified | +7 −0 |
| src/backend/access/rmgrdesc/heapdesc.c | modified | +16 −0 |
| src/backend/commands/tablecmds.c | modified | +95 −9 |
| src/backend/replication/logical/decode.c | modified | +41 −0 |
| src/backend/replication/logical/logical.c | modified | +43 −0 |
| src/backend/replication/logical/reorderbuffer.c | modified | +35 −0 |
| src/include/access/heapam_xlog.h | modified | +22 −1 |
| src/include/commands/tablecmds.h | modified | +2 −0 |
| src/include/replication/output_plugin.h | modified | +10 −0 |
| src/include/replication/reorderbuffer.h | modified | +23 −1 |