pg_clickhouse
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_clickhouse | 0.1.4 | OLAP | Apache-2.0 | C++ |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 2460 | pg_clickhouse | No | Yes | No | Yes | No | No | - |
| Related | pg_duckdb duckdb_fdw citus columnar citus_columnar clickhouse_fdw postgres_fdw dblink |
|---|
with submodule
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.1.4 | 1817161514 | pg_clickhouse | - |
| RPM | PIGSTY | 0.1.4 | 1817161514 | pg_clickhouse_$v | - |
| DEB | PIGSTY | 0.1.4 | 1817161514 | postgresql-$v-clickhouse | - |
Build
You can build the RPM / DEB packages for pg_clickhouse using pig build:
pig build pkg pg_clickhouse # build RPM / DEB packages
Install
You can install pg_clickhouse directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
pig repo add pgsql -u # Add repo and update cache
Install the extension using pig or apt/yum/dnf:
pig install pg_clickhouse; # Install for current active PG version
pig ext install -y pg_clickhouse -v 18 # PG 18
pig ext install -y pg_clickhouse -v 17 # PG 17
pig ext install -y pg_clickhouse -v 16 # PG 16
pig ext install -y pg_clickhouse -v 15 # PG 15
pig ext install -y pg_clickhouse -v 14 # PG 14
dnf install -y pg_clickhouse_18 # PG 18
dnf install -y pg_clickhouse_17 # PG 17
dnf install -y pg_clickhouse_16 # PG 16
dnf install -y pg_clickhouse_15 # PG 15
dnf install -y pg_clickhouse_14 # PG 14
apt install -y postgresql-18-clickhouse # PG 18
apt install -y postgresql-17-clickhouse # PG 17
apt install -y postgresql-16-clickhouse # PG 16
apt install -y postgresql-15-clickhouse # PG 15
apt install -y postgresql-14-clickhouse # PG 14
Create Extension:
CREATE EXTENSION pg_clickhouse;
Usage
pg_clickhouse enables analytics queries on ClickHouse directly from PostgreSQL without SQL rewriting.
It supports PostgreSQL 13+ and ClickHouse v23+.
Create the Extension
CREATE EXTENSION pg_clickhouse;
Or into a specific schema:
CREATE SCHEMA env;
CREATE EXTENSION pg_clickhouse SCHEMA env;
Query Pushdown
The extension automatically pushes down analytical queries to ClickHouse for execution, providing significant performance improvements. For example, TPC-H benchmarks show:
- Query 1: 268ms (vs 4,693ms on standard PostgreSQL)
- Query 6: 53ms (vs 764ms on standard PostgreSQL)
When query pushdown is active, ClickHouse handles execution directly, avoiding data transfer overhead for complex analytical workloads.
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.