ClickhouseAndrey Chudnovskiy, David Wheeler and Gülçin Yıldırım JelínekExplainer
PostgreSQL 19 on ClickHouse Managed Postgres, from day one
Summary
ClickHouse Managed Postgres made PostgreSQL 19 generally available on its release day, November 19, 2026, without a preview or waitlist. The engineering team leveraged the PGDG APT repository for the Postgres server and third-party extensions, packaging only first-party extensions themselves. A readiness checklist, VM images built from RC2, extension packaging, control plane feature flags, and end-to-end stress testing across AWS and GCP enabled the rapid rollout. Key PostgreSQL 19 features include the REPACK command with a CONCURRENTLY option for online table rewrites, the WAIT FOR LSN command for read-your-writes on replicas, logical replication improvements for sequences and EXCEPT, and the pg_plan_advice extension for plan stabilization. Performance benchmarks showed stable or slightly improved TPS compared to PostgreSQL 18, with new defaults such as jit off and lz4 compression.
Context
ClickHouse Managed Postgres is a fully managed PostgreSQL service that aims to provide the latest PostgreSQL versions immediately upon release. The post details the engineering process behind achieving day-one support for PostgreSQL 19, highlights new features, and explains their implications for the managed service.
Approach / What changed
The team used the PGDG APT repository for the Postgres server and third-party extensions, packaging only first-party extensions. They prepared VM images from PostgreSQL 19 RC2 with Ubicloud, set up control plane feature flags, and ran end-to-end stress tests across AWS and GCP covering HA, scaling, read replicas, telemetry, and billing. The separation of control plane and VM image deployments allowed rapid production rollout after validation.
Takeaways
REPACK CONCURRENTLY allows online table rewrites with minimal locking but requires free disk space and has limitations: it is not MVCC-safe, does not work on partitioned tables or tables without a primary key, and can fail if more than about 104 million rows change or DDL runs concurrently.
WAIT FOR LSN enables read-your-writes on asynchronous replicas without making every commit wait, but requires setting a TIMEOUT and a fallback plan; for sub-second lag, streaming replication is available through support.
pg_plan_advice allows plan stabilization but should be used cautiously because the planner usually makes good decisions and pinned plans can backfire when data changes; stashes in pg_stash_advice are cleared on restart.
FAQ
How does REPACK CONCURRENTLY work and what are its limitations?
REPACK CONCURRENTLY rewrites a table under a SHARE UPDATE EXCLUSIVE lock, capturing changes with logical decoding, and takes ACCESS EXCLUSIVE only for the final swap. It is not MVCC-safe, requires free disk space, does not work on partitioned tables or tables without a primary key, and can fail if too many rows change or DDL runs concurrently.
How can I achieve read-your-writes on a read replica?
Use the WAIT FOR LSN command on the replica to wait until WAL has been replayed to a specific LSN. Set a TIMEOUT and decide what to do on expiration, such as falling back to the primary. For sub-second lag, streaming replication is available through support.
How does pg_plan_advice work and how can I use it on ClickHouse Managed Postgres?
pg_plan_advice allows you to supply a plan for a query, which the planner will use if it matches. It ships with contrib modules and can be loaded per session via LOAD or session_preload_libraries. For application roles, set session_preload_libraries via ALTER ROLE. pg_stash_advice stores stashes in shared memory, but they are cleared on restart.
Source and freshness
- Source
- clickhouse.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.