# Postgres to ClickHouse: Real-Time CDC Pipeline Guide

DevFeed: [Postgres to ClickHouse: Real-Time CDC Pipeline Guide](<https://devfeed.tech/articles/postgres-to-clickhouse-real-time-cdc-pipeline-guide-82308.md>)

Original publisher: [Read original article](<https://estuary.dev/blog/postgres-to-clickhouse>)

Author: Jeffrey Richman

Published: 2025-05-29T14:00:00Z

Content type: tutorial

Language: en

Sources: [Estuary](<https://devfeed.tech/sources/estuary.md>)

Topics: [clickhouse](<https://devfeed.tech/topics/clickhouse.md>), [streaming data analytics](<https://devfeed.tech/topics/streaming-data-analytics.md>), [Event-Streaming](<https://devfeed.tech/topics/event-streaming.md>), [Analytics Pipeline](<https://devfeed.tech/topics/analytics-pipeline.md>), [schema-evolution](<https://devfeed.tech/topics/schema-evolution.md>), [Prometheus](<https://devfeed.tech/topics/prometheus.md>)

Tags: [2](<https://devfeed.tech/tags/2.md>), [3](<https://devfeed.tech/tags/3.md>), [about](<https://devfeed.tech/tags/about.md>), [analytics](<https://devfeed.tech/tags/analytics.md>), [building](<https://devfeed.tech/tags/building.md>), [capture](<https://devfeed.tech/tags/capture.md>), [cdc](<https://devfeed.tech/tags/cdc.md>), [change](<https://devfeed.tech/tags/change.md>), [change-data-capture](<https://devfeed.tech/tags/change-data-capture.md>), [clickhouse](<https://devfeed.tech/tags/clickhouse.md>), [data](<https://devfeed.tech/tags/data.md>), [dekaf](<https://devfeed.tech/tags/dekaf.md>), [guide](<https://devfeed.tech/tags/guide.md>), [live](<https://devfeed.tech/tags/live.md>), [pipeline](<https://devfeed.tech/tags/pipeline.md>), [postgres](<https://devfeed.tech/tags/postgres.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [real-time](<https://devfeed.tech/tags/real-time.md>), [tables](<https://devfeed.tech/tags/tables.md>), [time](<https://devfeed.tech/tags/time.md>), [with](<https://devfeed.tech/tags/with.md>), [write](<https://devfeed.tech/tags/write.md>)

## AI overview

The guide describes a Postgres-to-ClickHouse pipeline that reads inserts, updates, and deletes from PostgreSQL's write-ahead log through logical replication, captures them in an Estuary collection, then backfills and streams them to ClickHouse over its native protocol. It requires logical replication, a replication-privileged Postgres user, network access, ClickHouse credentials and database permissions, and an Estuary account. In standard mode, updates create versioned rows in ReplacingMergeTree; use FINAL to read deduplicated state. Deletes are soft by default, while hard deletes write tombstones; delta updates can reduce write amplification on high-churn tables. Alternatives include ClickHouse's native Postgres table engine for occasional reads, ClickPipes for ClickHouse Cloud ingestion, and Debezium with Kafka for teams that want to operate the pipeline. A Dekaf-to-ClickPipes path is also provided. Delivery is described as at least once by default, and the article's conclusion says exactly-once availability depends on destination configuration.

## Source excerpt

A step-by-step guide to building a real-time Postgres to ClickHouse pipeline with change data capture, from write-ahead log to live analytics tables.