Skip to content

clickhouse_fdw

ClickHouse foreign data wrapper for PostgreSQL

clickhouse_fdw · ClickHouse foreign data wrapper for PostgreSQL

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
100970clickhouse_fdwclickhouse_fdw1.4FDWApache-2.0C++

PostgreSQL · 11, 12, 13, 14, 15, 16, 17

Usage

Sources:

clickhouse_fdw is an archived foreign-data wrapper for ClickHouse. The reviewed release supports HTTP and binary drivers, remote-schema import, reads, inserts, and selected aggregate pushdown; upstream directs new users to its maintained successor.

CREATE EXTENSION clickhouse_fdw;
CREATE SERVER clickhouse_svr
  FOREIGN DATA WRAPPER clickhouse_fdw
  OPTIONS (dbname 'analytics', host 'clickhouse.internal', port '8123');
CREATE USER MAPPING FOR CURRENT_USER
  SERVER clickhouse_svr OPTIONS (user 'reporter', password 'secret');
IMPORT FOREIGN SCHEMA "analytics"
  FROM SERVER clickhouse_svr INTO clickhouse_ext;

Do not keep a literal password in deployment SQL; use restricted provisioning and catalog access. The HTTP driver sends queries to a remote service, so require TLS where supported, least-privilege ClickHouse credentials, network allowlists, timeouts, and resource limits. Keep ClickHouse in UTC as upstream requires and verify type, null, timestamp, and aggregation mappings.

Because this repository is archived, use its successor for new deployments. For legacy systems, pin dependencies such as libcurl and UUID libraries, inspect EXPLAIN VERBOSE for remote SQL, and test transaction semantics, partial writes, retries, cancellation, failover, predicate pushdown, and major-version upgrades before relying on it.

Table reader