ClickhouseDavid WheelerAnnouncement
pg_clickhouse 0.11.1: Now with pgvector, UPDATE, DELETE pushdown
Summary
pg_clickhouse 0.11.1 adds pgvector type mapping, requiring explicit CREATE FOREIGN TABLE to map ClickHouse Array(Float32) columns to PostgreSQL vector type, and pushes down pgvector operators including L2Distance, L1Distance, cosineDistance, and dotProduct to ClickHouse functions. The foreign data wrapper detects ClickHouse vector_similarity indexes such as HNSW and reports their usage in EXPLAIN output. UPDATE, DELETE, and TRUNCATE statements now push down to ClickHouse MergeTree tables, with UPDATE requiring enable_block_number_column and enable_block_offset_column settings. Linear regression aggregates push down on ClickHouse 26.9+, and NULL-returning aggregates use OrNull variants to return NULL instead of defaults. Additional changes include JSONB subscript pushdown, TimeZone synchronization, and unconstrained NUMERIC mapping to Decimal(76,38) with trailing zero trimming.
Takeaways
pg_clickhouse 0.11.1 maps ClickHouse Array(Float32) to PostgreSQL vector type and pushes down pgvector operators like L2Distance, L1Distance, cosineDistance, and dotProduct to ClickHouse functions, with detection of vector_similarity indexes.
UPDATE, DELETE, and TRUNCATE statements now push down to ClickHouse MergeTree tables; UPDATE requires enabling block_number and block_offset settings and is recommended for small row sets.
NULL-returning aggregates now use OrNull variants (e.g., sumOrNull) to return NULL instead of ClickHouse defaults, matching PostgreSQL behavior.
FAQ
How do I map a ClickHouse Array(Float32) column to a PostgreSQL vector type?
Use explicit CREATE FOREIGN TABLE with the vector type, as IMPORT FOREIGN SCHEMA does not support the mapping. For example, define v vector(4) NOT NULL for a column of Array(Float32) with four elements.
Can pg_clickhouse use ClickHouse vector similarity indexes?
Yes, pg_clickhouse detects vector_similarity indexes (e.g., HNSW) and reports their usage in EXPLAIN output. The index is used when the query uses the corresponding distance operator.
How do UPDATE and DELETE work in pg_clickhouse 0.11.1?
They push down as lightweight UPDATE or DELETE statements to ClickHouse MergeTree tables. UPDATE requires enabling enable_block_number_column and enable_block_offset_column settings. Without a WHERE clause, pg_clickhouse inserts WHERE true, so use TRUNCATE for full table deletion.
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.