Search code examples
postgresqlwallogical-replication

Is rollback transactions' data written into the Postres WAL?


I have a Postgres replication slot. I rollbacked a couple of transactions but the slot size increased drastically. I do not have any slot changes in it but the size has become huge.

Is it possible that the rollbacked transactions are still present in the WAL but not shown when I run the following command?

SELECT * FROM pg_logical_slot_peek_changes
              ('test_slot', NULL, NULL, 'include-xids', '1','include-timestamp','1');

Solution

  • Yes, all data modifying statements are WAL logged, no matter if the transaction commits or rolls back. Logical decoding has to chew through all these data.