-- Root tableCREATE TABLE stage.d_v_operator (
df_operator_key int4 NOT NULL,
df_druh_hry varchar NOT NULL,
df_trigger_off_sdc2_group_history bool NULL,
df_created timestamptz NOT NULL DEFAULT now(),
df_valid bool NOT NULL DEFAULT true,
df_v_operator_key int8 NOT NULL,
idoperator varchar NULL,
operatornazev varchar NULL,
df_group_00_df_master_package_key int8 NULL,
CONSTRAINT d_v_operator_pk PRIMARY KEY (df_operator_key, df_druh_hry, df_created, df_v_operator_key)
)
PARTITION BY RANGE (df_operator_key, df_druh_hry, df_created);
-- 1. level partition
CREATE TABLE stage.d_v_operator_11223344_t_2112 PARTITION OF stage.d_v_operator FOR VALUES FROM (11223344, 'T', '2021-12-01 00:00:00+01') TO (11223344, 'T', '2021-12-31 23:59:59.999+01');
Every table has using index of replica identity, for example:
ALTER TABLE stage.d_v_operator REPLICA IDENTITY USING INDEX d_v_operator_pk;
Now we have table with multi level partitions. Root table has 3 level partitions, for example below:
-- Root table
CREATE TABLE stage.s_v_operator (
df_package_key int8 NOT NULL,
df_operator_key int4 NOT NULL,
df_druh_hry varchar NOT NULL,
obdobi tstzrange NULL,
idoperator varchar NULL,
operatornazev varchar NULL,
df_v_operator_key int8 NOT NULL,
rowhash text NOT NULL,
CONSTRAINT s_v_operator_pkey PRIMARY KEY (df_package_key, df_v_operator_key, df_operator_key, df_druh_hry)
)
PARTITION BY LIST (df_druh_hry);
-- 1. level partition
CREATE TABLE stage.s_v_operator_default PARTITION OF stage.s_v_operator DEFAULT;
CREATE TABLE stage.s_v_operator_t PARTITION OF stage.s_v_operator FOR VALUES IN ('T') PARTITION BY LIST (df_operator_key);
-- 2. level partition
CREATE TABLE stage.s_v_operator_t_11223344 PARTITION OF stage.s_v_operator_t FOR VALUES IN (11223344) PARTITION BY LIST (df_package_key);
-- 3. level partition
CREATE TABLE stage.s_v_operator_t_11223344_269811 PARTITION OF stage.s_v_operator_t_11223344 FOR VALUES IN ('269811');
Debezium not load changes to kafka for this tables. Log have not errors. We have schema and tables in white list in connector properties and this tables we have added to publication of PostgreSQL.
Do you have idea why can not read changes? Support multilevel partitions of table Debezium?
Thank you very much,Jan