The attached patch adds TRUNCATE callback for the decoder_raw extension.
Please check it, and merge the feature if valuable.
I think the patch itself is obvious.
My motivation is ....
We had a big database upgrade project (v17 -> v18) that involves more than 100k tables and 25TB storage.
It is too large for pg_dump/pg_restore, so we used pg_upgrade and pg_recvlogical with raw_decoder, to save
the logical update logs at the production system during pg_upgrade at the cloned database instance on EC2.
However, it didn't work because some batch queries used TRUNCATE command, and it leads primary-key
conflicts on some tables when we applies the generates SQL files on the cloned database instance.
So, we need to support TRUNCATE command here.
decoder_raw-add-truncate.v1.patch
The attached patch adds TRUNCATE callback for the decoder_raw extension.
Please check it, and merge the feature if valuable.
I think the patch itself is obvious.
My motivation is ....
We had a big database upgrade project (v17 -> v18) that involves more than 100k tables and 25TB storage.
It is too large for pg_dump/pg_restore, so we used pg_upgrade and pg_recvlogical with raw_decoder, to save
the logical update logs at the production system during pg_upgrade at the cloned database instance on EC2.
However, it didn't work because some batch queries used TRUNCATE command, and it leads primary-key
conflicts on some tables when we applies the generates SQL files on the cloned database instance.
So, we need to support TRUNCATE command here.
decoder_raw-add-truncate.v1.patch