mirror of
https://github.com/postgres/postgres.git
synced 2025-06-29 10:41:53 +03:00
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>
This commit is contained in:
@ -9260,6 +9260,13 @@ heap_redo(XLogReaderState *record)
|
||||
case XLOG_HEAP_UPDATE:
|
||||
heap_xlog_update(record, false);
|
||||
break;
|
||||
case XLOG_HEAP_TRUNCATE:
|
||||
/*
|
||||
* TRUNCATE is a no-op because the actions are already logged as
|
||||
* SMGR WAL records. TRUNCATE WAL record only exists for logical
|
||||
* decoding.
|
||||
*/
|
||||
break;
|
||||
case XLOG_HEAP_HOT_UPDATE:
|
||||
heap_xlog_update(record, true);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user