Description
The official PeerDB documentation lists soft_delete = <true|false> as a valid WITH option for CREATE MIRROR (CDC), but the SQL parser (nexus/analyzer/src/lib.rs) does not implement this option. Only soft_delete_col_name = '<column_name>' is parsed.
Behavior
When using:
CREATE MIRROR my_mirror
FROM source_peer TO destination_peer
WITH TABLE MAPPING (public.my_table:public.my_table)
WITH (
do_initial_copy = true,
soft_delete = true
);
- No error is raised
- The mirror is created successfully
soft_delete is silently ignored — the _peerdb_is_deleted column is never added to the destination table
- Deletes from the source are propagated as hard deletes to the destination
Expected Behavior
Either:
soft_delete = true should be a valid alias that sets soft_delete_col_name to _peerdb_is_deleted, or
- An error should be raised informing the user that
soft_delete is not a recognized option and soft_delete_col_name should be used instead
Workaround
Use soft_delete_col_name = '_peerdb_is_deleted' explicitly:
CREATE MIRROR my_mirror
FROM source_peer TO destination_peer
WITH TABLE MAPPING (public.my_table:public.my_table)
WITH (
do_initial_copy = true,
soft_delete_col_name = '_peerdb_is_deleted'
);
Environment
- PeerDB version:
v0.36.17
- Source peer: PostgreSQL
- Destination peer: PostgreSQL (reproduced on both PG→PG and PG→ClickHouse)
References
Description
The official PeerDB documentation lists
soft_delete = <true|false>as a validWITHoption forCREATE MIRROR(CDC), but the SQL parser (nexus/analyzer/src/lib.rs) does not implement this option. Onlysoft_delete_col_name = '<column_name>'is parsed.Behavior
When using:
soft_deleteis silently ignored — the_peerdb_is_deletedcolumn is never added to the destination tableExpected Behavior
Either:
soft_delete = trueshould be a valid alias that setssoft_delete_col_nameto_peerdb_is_deleted, orsoft_deleteis not a recognized option andsoft_delete_col_nameshould be used insteadWorkaround
Use
soft_delete_col_name = '_peerdb_is_deleted'explicitly:Environment
v0.36.17References
soft_delete = <true|false>: https://docs.peerdb.io/mirror/cdc-pg-pgsoft_delete_col_name:nexus/analyzer/src/lib.rsline ~302