Skip to content

Change data not captured properly while operating with partition tables #259

@MohamedKamarudeen

Description

@MohamedKamarudeen

Created table and partition table in Postgres DB using the following DDLs:

--root table / partitioned table
create table public.test_partition (id int , name varchar(20)) partition by range(id);

--partitions
create table public.test_partition_P00 partition of public.test_partition for values from (1) to (100);
create table public.test_partition_P01 partition of public.test_partition for values from (101) to (200);

With the above setup, these are the two issues which are faced :

  1. When the replication slot is configured to read change data of root and partition tables, the table name received as part of the raw transaction is the partition name and not the actual root table name(partitioned table)
    For example :
  • Insert 1 record to public.test_partition
  • Sample transaction object received -> [ tableName : 'public.test_partition_P00', operation : ' INSERT' ..]
    Query : Why is the received event containing the table name as a partition name(public.test partition_P00) rather than the root table name(public.test partition)?
  1. If the slot is configured only with the partitioned root table(public.test_partition), change data is not captured.
    Query : Why is the change data not captured in this scenario?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions