Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

ClickHouse 8 min read Release mediumAdept

pg_clickhouse & chdb updates: Encoding, nesting, and types

pg_clickhouse v0.11.0 and the chdb extension v0.1.2 improve Postgres–ClickHouse type compatibility. A new `check_encoding` option (fail, remove, replace, truncate) handles invalidly encoded text, and ClickHouse Interval types now import as Postgres `interval` with pushdown of expressions like `start_at + duration`. Parameterized JSON columns map to jsonb so `ORDER BY` on a property pushes down correctly, and unflattened Nested columns map to 2-D text arrays or to matching composite-type arrays. The release also adds mappings for large integers, geo and time types, pushes down the sha*/digest functions, removes `clickhouse_raw_query()` and drops PostgreSQL 13 support.

Related posts

  • What's New in pg_clickhouse - JSONB Support, SQL value functions, Streaming, and more

    ClickHouse mediumAdept

    pg_clickhouse, the Postgres foreign data wrapper for querying ClickHouse, now pushes down far more operations to ClickHouse. JSONB accessors (->, ->>, jsonb_extract_path) are translated to ClickHouse sub-column syntax. CURRENT_DATE, CURRENT_TIMESTAMP and clock_timestamp() are translated to ClickHouse now()/now64()/nowInBlock64 calls that use the Postgres session time zone and timestamp precision. Array functions now map to their ClickHouse equivalents. Streaming of HTTP driver results in roughly 50MB batches kept container memory under about 100MiB during a full NYC taxi table scan, versus about 600MiB without it.

  • pg_clickhouse 0.11.1: Now with pgvector, UPDATE, DELETE pushdown

    ClickHouse mediumAdept

    pg_clickhouse 0.11.1 maps pgvector's vector type to ClickHouse Array(Float32/Float64) columns. It pushes pgvector distance operators down to ClickHouse functions such as L2Distance and cosineDistance, and reports in EXPLAIN whether a ClickHouse vector_similarity HNSW index applies. It also pushes UPDATE and DELETE down as ClickHouse lightweight updates and deletes on MergeTree tables, along with TRUNCATE; lightweight updates need block number/offset settings enabled and suit changes to under about 10% of a table. Other changes include regr_* aggregate pushdown, OrNull aggregates that match Postgres NULL semantics, JSONB subscript pushdown, session timezone alignment, and Decimal(76,38) for unconstrained numeric.

  • Introducing pg_clickhouse: A Postgres extension for querying ClickHouse

    ClickHouse mediumAdept

    pg_clickhouse v0.1.0 is an Apache 2-licensed PostgreSQL foreign data wrapper, derived from clickhouse_fdw, that runs analytics queries on ClickHouse from Postgres so existing queries can work unmodified by changing search_path. It modernizes the code with PGXS builds, CI across PostgreSQL 13-18 and ClickHouse 22-25, TLS, and Bool/Decimal/JSON types. Its main advance is pushdown: ordered-set aggregates like percentile_cont() are rewritten to ClickHouse quantile() and FILTER clauses become -If combinators. SEMI JOIN pushdown plus planner cost tuning brought 21 of 22 TPC-H queries under 1s, with 12 fully pushed down.

  • What's New in pg_clickhouse v0.3.2: Postgres 19, TLS, Regex, and Memory

    ClickHouse mediumAdept

    pg_clickhouse v0.3.2, the Postgres extension for querying ClickHouse, adds support for PostgreSQL 19 Beta1 and needs no restart or ALTER EXTENSION UPDATE. New CREATE SERVER options cover TLS behavior (`secure` on/off/auto, `min_tls_version`) and native protocol compression. Regex flag pushdown has been corrected, with a mapping table and a warning that Postgres and ClickHouse treat negated character classes differently around newlines. The release also fixes memory ballooning in repeatedly re-scanned parameterized foreign scans and in unbuffered HTTP queries, pushes down capture-free regexp_match(), and fixes empty-array ANY() errors on older ClickHouse.

  • ClickHouse Release 24.8 LTS

    ClickHouse mediumAdept

    ClickHouse 24.8 is a Long Term Support release (supported for 12 months) with 19 new features, 18 performance optimisations and 65 bug fixes. Headline additions include an experimental JSON data type built on Variant and Dynamic, a table engine for time-series data, exactly-once processing of Kafka messages, and join improvements. The JSON type is shown in detail: dot syntax reads literal paths efficiently, `.^` returns subobjects, `.:Type` and `::Type` assume or cast types, and `SKIP`, `SKIP REGEXP` and per-path type hints control what is stored. A new `deduplicate_merge_projection_mode` setting controls how projections behave when ReplacingMergeTree or AggregatingMergeTree merges drop or fold rows. Previously, projections either silently fell out of sync or blocked those operations.

The quest for software engineering knowledge.

Look:
Layout: