ClickHouse integration

[Edit this page](https://github.com/ClickHouse/clickhouse-docs/blob/main/docs/cloud/managed-postgres/clickhouse-integration.md)

[Private preview](https://clickhouse.com/cloud/postgres)

Every Managed Postgres instance comes with built-in CDC capabilities to any of your ClickHouse services. This allows you to move some or all of the data on your Postgres instance to ClickHouse and have changes in data on Postgres be reflected on ClickHouse continuous and nearly real-time. This is powered by [ClickPipes](/docs/integrations/clickpipes) under the hood.

To access this, click on **ClickHouse Integration** in the sidebar of your Postgres instance.

Note

Before you proceed, ensure that your Postgres service is accessible to the ClickPipes service. This should be the case by default, but if you've restricted IP access you may need to grant access to some source IPs from [this](/docs/integrations/clickpipes#list-of-static-ips) list based on the region where your **ClickHouse service** is located.

Click **Replicate data in ClickHouse** to start setting up your ClickPipe.

Configure the replication service

## Configure the replication service[​](#configure-replication-service "Direct link to Configure the replication service")

Fill in the replication settings:

- **Integration name**: A name for this ClickPipe
- **ClickHouse service**: Select an existing ClickHouse Cloud service or create a new one
- **Postgres database**: The source database to replicate from
- **Replication method**: Choose one of:
  - **Initial load + CDC**: Import existing data and keep tables updated with new changes (recommended)
  - **Initial load only**: One-time snapshot of existing data with no ongoing updates
  - **CDC only**: Skip the initial snapshot and only capture new changes going forward

Click **Next** to proceed.

Select tables to replicate

## Select tables to replicate[​](#select-tables "Direct link to Select tables to replicate")

Choose a destination database and select which tables to replicate:

- **Destination database**: Select an existing ClickHouse database or create a new one
- **Prefix default destination table names with schema name**: Adds the Postgres schema as a prefix to avoid naming conflicts
- **Preserve NULL values from source**: Maintains NULL values instead of converting to defaults
- **Remove deleted rows during merges**: For [ReplacingMergeTree](/docs/engines/table-engines/mergetree-family/replacingmergetree) tables, physically removes deleted rows during background merges

Expand schemas and select individual tables to replicate. You can also customize destination table names and column settings.

Click **Replicate data to ClickHouse** to start the replication.

Monitor your ClickPipe

## Monitor your ClickPipe[​](#monitor-clickpipe "Direct link to Monitor your ClickPipe")

Once the ClickPipe starts, you'll see it listed in the same menu. The initial snapshot of all data may take some time depending on the size of your tables.

Click on the integration name to view detailed status, monitor progress, view errors, and manage the ClickPipe. See [Lifecycle of a Postgres ClickPipe](/docs/integrations/clickpipes/postgres/lifecycle) to understand the different states your ClickPipe may be in.

- [Configure the replication service](#configure-replication-service)- [Select tables to replicate](#select-tables)- [Monitor your ClickPipe](#monitor-clickpipe)

Was this page helpful?