ClickHouse / ClickHouse/ClickHouse
Migrate PostgreSQL `partitioned tables` via ENGINE **MaterializedPostgreSQL**
- Dominant language
- C++
- Stars
- 49.9k
- Forks
- 9k
- Avg merge
- 21h 32m
- Merged PRs (30d)
- 515
Description
Trying to create a **ClickHouse** database (version 23.9.3) with tables from **PostgreSQL** database (version 14.4 zalando patroni) via [official instruction](https://clickhouse.com/docs/en/engines/database-engines/materialized-postgresql#logical-replication-slot-failover)
Tables with type `table` work correctly.
Tables with type `partitioned tables` does not - no data inside parent table.
Also manually modified option `publish_via_partition_root` for automatically created publication by CH:
`ALTER publication name_db_ch_publication SET (publish_via_partition_root=true);`
From [documentation](https://www.postgresql.org/docs/14/sql-createpublication.html):
> This parameter determines whether changes in a partitioned table (or on its partitions) contained in the publication will be published using the identity and schema of the partitioned table rather than that of the individual partitions that are actually changed; the latter is the default. Enabling this allows the changes to be replicated into a non-partitioned table or a partitioned table consisting of a different set of partitions.
If this is enabled, TRUNCATE operations performed directly on partitions are not replicated.
After that new rows for tables with type `partitioned tables` are coming in parent tables CH, but no initial data.
Is there any way to migrate initial data from tables with type `partitioned tables` for parent table ?
Contributor guide
Assessment
This issue has not been assessed yet.