This release makes binary-only changes. Once installed, any existing use of pg_clickhouse v0.11 will get its benefits on reload without needing to ALTER EXTENSION UPDATE.
🚨 Compatibility
- Changed the default driver from "http" to "binary". Use
OPTIONS(driver 'http')to restore use of the HTTP driver if needed. - Changed
pg_clickhouse.session_settingsto override built-in settings by key rather than replace them. It now defaults to an empty string, and pg_clickhouse always sendsjoin_use_nulls 1, group_by_use_nulls 1, final 1, transform_null_in 0unless overridden. Setting it to an empty string no longer drops these settings (#412).
⚡ Improvements
- Added pushdown for more regression aggregate functions on ClickHouse 26.9+:
- Added pushdown support for pgvector
vectorcolumns stored in ClickHouse asArray(Float32),Array(Float64), andArray(BFloat16)columns.vectorconstants and parameters push down asArray(Float32), and the pgvector=and<>operators also push down (#410). - Added pushdown of the pgvector distance operators
<->,<=>,<#>, and<+>, as well as thel2_distance,cosine_distance,inner_product,l1_distance, andvector_dimsfunctions, to allow nearest-neighbor queries sort and limit in ClickHouse.<#>sorts asdotProduct(...) DESC, the form ClickHouse vector similarity indexes serve, and requires ClickHouse 23.8 or later (#411). - Added the
settingsoption for foreign servers and foreign tables to send ClickHouse settings with foreign table queries and inserts. Usespg_clickhouse.session_settingssyntax. Table settings override server settings, andpg_clickhouse.session_settingsoverrides both for matching keys. Includes a warning for certain settings unsupported by older servers (currently vector search settings) (#412). - Added pushdown the math operators
^,|/,||/,@,&,|,#,~,<<, and>>(#443). - Added vector index reporting for pgvector nearest neighbor searches.
EXPLAINshows the ClickHouse vector similarity index a search can use, or why ClickHouse will compare every row instead. Planner warnings reportORDER BYorLIMITclauses that prevent index use. Setpg_clickhouse.vector_planner_warningsto false to silence them (#414). - Added pushdown of
jsonbsubscripts with constant text keys, such asdata['a']['b'], as ClickHouse JSON sub-column dot notation. Numeric text subscripts evaluate locally to preserve array indexing (#456). - Added
UPDATEandDELETEon foreign tables backed by MergeTree family tables, run as a single ClickHouse lightweightUPDATEorDELETEstatement. Statements that cannot run entirely in ClickHouse, such as those withRETURNING, joins, or conditions that require Postgres, raise an error.UPDATErequires ClickHouse 25.7+ (#458). - Added support for
TRUNCATEon foreign tables. Sends one ClickHouseTRUNCATE TABLEstatement per table (#463).
🚀 Distribution
- Added Postgres 19rc1 OCI image.
- Added CloudNativePG extension images.
📚 Documentation
- Expanded the Tuple section of the documentation to describe and provide examples for mapping to arrays of field values, and to link to the section that covers using composite types (#460).
- Added a link to the Manual Type Mappings section to the Map documentation and clarified support for inserting composite values (#460).
- Updated the Manual Type Mappings section of the docs to describe and provide an example of inserting composite types mapped to Map, Tuple, and Nested columns (#460).
🐞 Bug Fixes
- Fixed unconstrained numeric casts and parameters to use
Decimal(76, 38), wideningFloat32before casting to preserve fractional values (#402). - Fixed precision loss in
float4andfloat8query parameter literals sent to ClickHouse. They were formatted with six decimal places, so ClickHouse parsed a different value, such as zero for1e-10. They now use the shortest text that parses back to the same value. Column values were not affected (#403). - Fixed ClickHouse type mappings for pushed-down casts and parameters, where previously invalid casts would cause remote query failures (#401).
- Fixed time zone handling in pushed down date/time functions and casts by using PostgreSQL's
TimeZone, including fixed UTC offsets such asSET TIME ZONE 5.AT TIME ZONEand epoch extraction now correctly handletimestampvalues without a time zone, matching PostgreSQL results. Connections to ClickHouse 23.6+ now also setsession_timezoneto match the PostgreSQLTimeZone(#413). - Fixed a GCC 15 build failure caused by a
-Wclobberederror in the binary driver connection setup (#395). - Added checks to prevent the pushdown of custom functions or pg_clickhouse's own local functions (#397).
- Added checks to prevent pushdown of types and operators from extensions without known ClickHouse equivalents, such as citext and intarray operators, which previously caused ClickHouse syntax errors (#405).
- Fixed datetime arithmetic interval parameters, such as
ts + $1, which failed once prepared statements switched to generic plans. Other expressions using interval parameters now evaluate locally (#406). - Fixed backend crashes, heap corruption, and hangs when a connection closed while a scan or binary
INSERTstill used it, for example after a PL/pgSQL block caught an error from a binaryINSERTor from the middle of a scan, and afterALTER SERVERorALTER USER MAPPINGwhile a cursor was open (#415). - Removed pushdown for aggregates with
ORDER BY, such asarray_agg(x ORDER BY y); previously they dropped theORDER BY. They now run in Postgres (#416). - Fixed
INSERT INTO foreign_table SELECT ... FROM foreign_tablewith the binary driver when both tables belong to the same server, which failed with "Unexpected packet Query received from client" (#417). - Fixed failure to close connections for dropped user mappings or servers, which stayed open with their sockets and memory until the session ended (#430).
- Fixed memory growth in PL/pgSQL loops and procedures that run many
INSERTs into foreign tables. EachINSERTkept its writer and buffers, up to the size of its largest batch, until the outermost statement ended (#431). - Fixed leaks and a crash when a PL/pgSQL block caught an error raised by a ClickHouse query. A foreign scan's cursor and response remained in memory until the outermost statement ended, and the connection remained until the transaction ended, so that later queries each opened a connection of their own. Catching two errors from
clickhouse_query()in one transaction crashed the backend (#432). - Eliminated entries for dropped function, type, and operator definitions from the push-down cache (#434).
- Fixed the HTTP driver's reporting of exceptions that ClickHouse raises after it starts sending results, which appeared as garbled errors such as "unknown type: f". It now properly reports the ClickHouse exception (#436).
- Fixed a heap overflow in pushed-down joins that fetch no columns, such as a partition-wise
COUNT(*)self-join of foreign partitions. Each row wrote one byte past the end of a zero-length array (#438). - Fixed remote queries that truncated
column_namevalues longer than 63 bytes.IMPORT FOREIGN SCHEMAnow preserves full column names incolumn_nameoptions when PostgreSQL truncates local names. It also matchesLIMIT TOandEXCEPTagainst truncated table names (#446). - Fixed
CollapsingMergeTreesign column validation and quoting, which allowed SQL expressions in malformed quoted names and failed to escape backslashes in unquoted names.IMPORT FOREIGN SCHEMAnow preserves sign column names containing closing parentheses (#450). - Fixed aggregates such as
sum,avg, andminto returnNULLfor empty input, matching PostgreSQL. This also applies when no rows pass an aggregate'sFILTERclause (#451). - Fixed
round()and other expressions over an unconstrained numeric, which previously kept the full 38 decimal places ofDecimal(76, 38). For example,round(avg(f64_column)::numeric)now returns3instead of3.00000000000000000000000000000000000000. Thanks to Niramay Kelkar for the PR (#459)! - Fixed ClickHouse identifier quoting for database, table, column, and JSON key names containing backslashes (#457).
- Fixed
INSERT,COPY, andUPDATEthrough partitioned parents with ClickHouse foreign partitions. pg_clickhouse now rejects partition-key updates on foreign partitions to prevent rows from disappearing from pruned queries (#464).
🆚 For more detail compare changes since v0.11.0.