Skip to content

[BUG] soft_delete = true silently ignored in CREATE MIRROR SQL — only soft_delete_col_name is implemented #4187

Description

@rogerioefonseca

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions