ch_table_engines
pg_ch_table_engines · ClickHouse MergeTree-family table access methods with PostgreSQL MVCC.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 102257 | ch_table_engines | pg_ch_table_engines | 0.1 | OLAP | Apache-2.0 | C |
Usage
Sources:
ch_table_engines 0.1 exposes ClickHouse MergeTree-family table access methods on unmodified PostgreSQL 19, with PostgreSQL catalogs controlling snapshot visibility. It needs the separately supplied libchte_engine.so, built from ClickHouse 26.8.8.8-lts. This early project is independent of ClickHouse, Inc.
Core Workflow
Permanent tables require preloading and a PostgreSQL restart. Configure the engine library through ch.engine_library if its default location does not match the installation:
As a superuser, install the non-relocatable extension, which owns schema ch:
TEMP and UNLOGGED tables can work without preload, but permanent tables need the WAL resource manager registered at server startup. Normal persistent deployments should use the preloaded configuration, which also enables merge workers.
Engines, Options and Maintenance
The installed methods are mergetree, replacingmergetree, summingmergetree, aggregatingmergetree, collapsingmergetree, versionedcollapsingmergetree and coalescingmergetree. At this revision, automatic and session merges apply only to MergeTree tables; do not assume that the other methods already perform their expected merge reductions.
storagechooses buffered relation pages or directories of files;order_by,primary_key,index_granularity,compressionandlow_cardinalitydescribe part layout. Layout-defining options change only on empty tables. Theprimary_keyoption is a storage key, not a PostgreSQL uniqueness constraint.ch.parts,ch.definition,ch.table_sizeandch.engine_infoinspect tables and the engine.ch.foldrewrites parts to omit rows deleted for every snapshot;ch.optimize(rel, final)merges parts. VACUUM releases obsolete part storage after catalog visibility permits it.ch.max_merge_workersdefaults to 2 andch.merge_naptimeto 10 seconds. Workers do not merge on standbys.
Boundaries
Unique indexes, exclusion constraints, concurrent index builds and BRIN are unsupported. This also rules out primary-key constraints and unique arbiters for ON CONFLICT. Row-lock modes currently all behave exclusively. Test the required type, transaction, backup and recovery behavior before adoption; the index and merge restrictions are material storage limitations.