pg_ducklake
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_ducklake | 1.0.0 | OLAP | MIT | C++ |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 2490 | pg_ducklake | No | Yes | Yes | Yes | No | No | ducklake |
| Related | pg_duckdb duckdb_fdw pg_mooncake pg_analytics pg_parquet columnar citus_columnar |
|---|
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.0.0 | 1817161514 | pg_ducklake | - |
| RPM | PIGSTY | 1.0.0 | 1817161514 | pg_ducklake_$v | - |
| DEB | PIGSTY | 1.0.0 | 1817161514 | postgresql-$v-pg-ducklake | - |
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS |
| el8.aarch64 | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS |
| el9.x86_64 | PIGSTY 1.0.0 el9.x86_64.pg18 : pg_ducklake_18 pg_ducklake_18-1.0.0-1PIGSTY.el9.x86_64.rpm
| PIGSTY 1.0.0 el9.x86_64.pg17 : pg_ducklake_17 pg_ducklake_17-1.0.0-1PIGSTY.el9.x86_64.rpm
| PIGSTY 1.0.0 el9.x86_64.pg16 : pg_ducklake_16 pg_ducklake_16-1.0.0-1PIGSTY.el9.x86_64.rpm
| PIGSTY 1.0.0 el9.x86_64.pg15 : pg_ducklake_15 pg_ducklake_15-1.0.0-1PIGSTY.el9.x86_64.rpm
| PIGSTY 1.0.0 el9.x86_64.pg14 : pg_ducklake_14 pg_ducklake_14-1.0.0-1PIGSTY.el9.x86_64.rpm
|
| el9.aarch64 | PIGSTY 1.0.0 el9.aarch64.pg18 : pg_ducklake_18 pg_ducklake_18-1.0.0-1PIGSTY.el9.aarch64.rpm
| PIGSTY 1.0.0 el9.aarch64.pg17 : pg_ducklake_17 pg_ducklake_17-1.0.0-1PIGSTY.el9.aarch64.rpm
| PIGSTY 1.0.0 el9.aarch64.pg16 : pg_ducklake_16 pg_ducklake_16-1.0.0-1PIGSTY.el9.aarch64.rpm
| PIGSTY 1.0.0 el9.aarch64.pg15 : pg_ducklake_15 pg_ducklake_15-1.0.0-1PIGSTY.el9.aarch64.rpm
| PIGSTY 1.0.0 el9.aarch64.pg14 : pg_ducklake_14 pg_ducklake_14-1.0.0-1PIGSTY.el9.aarch64.rpm
|
| el10.x86_64 | PIGSTY 1.0.0 el10.x86_64.pg18 : pg_ducklake_18 pg_ducklake_18-1.0.0-1PIGSTY.el10.x86_64.rpm
| PIGSTY 1.0.0 el10.x86_64.pg17 : pg_ducklake_17 pg_ducklake_17-1.0.0-1PIGSTY.el10.x86_64.rpm
| PIGSTY 1.0.0 el10.x86_64.pg16 : pg_ducklake_16 pg_ducklake_16-1.0.0-1PIGSTY.el10.x86_64.rpm
| PIGSTY 1.0.0 el10.x86_64.pg15 : pg_ducklake_15 pg_ducklake_15-1.0.0-1PIGSTY.el10.x86_64.rpm
| PIGSTY 1.0.0 el10.x86_64.pg14 : pg_ducklake_14 pg_ducklake_14-1.0.0-1PIGSTY.el10.x86_64.rpm
|
| el10.aarch64 | PIGSTY 1.0.0 el10.aarch64.pg18 : pg_ducklake_18 pg_ducklake_18-1.0.0-1PIGSTY.el10.aarch64.rpm
| PIGSTY 1.0.0 el10.aarch64.pg17 : pg_ducklake_17 pg_ducklake_17-1.0.0-1PIGSTY.el10.aarch64.rpm
| PIGSTY 1.0.0 el10.aarch64.pg16 : pg_ducklake_16 pg_ducklake_16-1.0.0-1PIGSTY.el10.aarch64.rpm
| PIGSTY 1.0.0 el10.aarch64.pg15 : pg_ducklake_15 pg_ducklake_15-1.0.0-1PIGSTY.el10.aarch64.rpm
| PIGSTY 1.0.0 el10.aarch64.pg14 : pg_ducklake_14 pg_ducklake_14-1.0.0-1PIGSTY.el10.aarch64.rpm
|
| d12.x86_64 | PIGSTY 1.0.0 d12.x86_64.pg18 : postgresql-18-pg-ducklake postgresql-18-pg-ducklake_1.0.0-1PIGSTY~bookworm_amd64.deb
| PIGSTY 1.0.0 d12.x86_64.pg17 : postgresql-17-pg-ducklake postgresql-17-pg-ducklake_1.0.0-1PIGSTY~bookworm_amd64.deb
| PIGSTY 1.0.0 d12.x86_64.pg16 : postgresql-16-pg-ducklake postgresql-16-pg-ducklake_1.0.0-1PIGSTY~bookworm_amd64.deb
| PIGSTY 1.0.0 d12.x86_64.pg15 : postgresql-15-pg-ducklake postgresql-15-pg-ducklake_1.0.0-1PIGSTY~bookworm_amd64.deb
| PIGSTY 1.0.0 d12.x86_64.pg14 : postgresql-14-pg-ducklake postgresql-14-pg-ducklake_1.0.0-1PIGSTY~bookworm_amd64.deb
|
| d12.aarch64 | PIGSTY 1.0.0 d12.aarch64.pg18 : postgresql-18-pg-ducklake postgresql-18-pg-ducklake_1.0.0-1PIGSTY~bookworm_arm64.deb
| PIGSTY 1.0.0 d12.aarch64.pg17 : postgresql-17-pg-ducklake postgresql-17-pg-ducklake_1.0.0-1PIGSTY~bookworm_arm64.deb
| PIGSTY 1.0.0 d12.aarch64.pg16 : postgresql-16-pg-ducklake postgresql-16-pg-ducklake_1.0.0-1PIGSTY~bookworm_arm64.deb
| PIGSTY 1.0.0 d12.aarch64.pg15 : postgresql-15-pg-ducklake postgresql-15-pg-ducklake_1.0.0-1PIGSTY~bookworm_arm64.deb
| PIGSTY 1.0.0 d12.aarch64.pg14 : postgresql-14-pg-ducklake postgresql-14-pg-ducklake_1.0.0-1PIGSTY~bookworm_arm64.deb
|
| d13.x86_64 | PIGSTY 1.0.0 d13.x86_64.pg18 : postgresql-18-pg-ducklake postgresql-18-pg-ducklake_1.0.0-1PIGSTY~trixie_amd64.deb
| PIGSTY 1.0.0 d13.x86_64.pg17 : postgresql-17-pg-ducklake postgresql-17-pg-ducklake_1.0.0-1PIGSTY~trixie_amd64.deb
| PIGSTY 1.0.0 d13.x86_64.pg16 : postgresql-16-pg-ducklake postgresql-16-pg-ducklake_1.0.0-1PIGSTY~trixie_amd64.deb
| PIGSTY 1.0.0 d13.x86_64.pg15 : postgresql-15-pg-ducklake postgresql-15-pg-ducklake_1.0.0-1PIGSTY~trixie_amd64.deb
| PIGSTY 1.0.0 d13.x86_64.pg14 : postgresql-14-pg-ducklake postgresql-14-pg-ducklake_1.0.0-1PIGSTY~trixie_amd64.deb
|
| d13.aarch64 | PIGSTY 1.0.0 d13.aarch64.pg18 : postgresql-18-pg-ducklake postgresql-18-pg-ducklake_1.0.0-1PIGSTY~trixie_arm64.deb
| PIGSTY 1.0.0 d13.aarch64.pg17 : postgresql-17-pg-ducklake postgresql-17-pg-ducklake_1.0.0-1PIGSTY~trixie_arm64.deb
| PIGSTY 1.0.0 d13.aarch64.pg16 : postgresql-16-pg-ducklake postgresql-16-pg-ducklake_1.0.0-1PIGSTY~trixie_arm64.deb
| PIGSTY 1.0.0 d13.aarch64.pg15 : postgresql-15-pg-ducklake postgresql-15-pg-ducklake_1.0.0-1PIGSTY~trixie_arm64.deb
| PIGSTY 1.0.0 d13.aarch64.pg14 : postgresql-14-pg-ducklake postgresql-14-pg-ducklake_1.0.0-1PIGSTY~trixie_arm64.deb
|
| u22.x86_64 | PIGSTY 1.0.0 u22.x86_64.pg18 : postgresql-18-pg-ducklake postgresql-18-pg-ducklake_1.0.0-1PIGSTY~jammy_amd64.deb
| PIGSTY 1.0.0 u22.x86_64.pg17 : postgresql-17-pg-ducklake postgresql-17-pg-ducklake_1.0.0-1PIGSTY~jammy_amd64.deb
| PIGSTY 1.0.0 u22.x86_64.pg16 : postgresql-16-pg-ducklake postgresql-16-pg-ducklake_1.0.0-1PIGSTY~jammy_amd64.deb
| PIGSTY 1.0.0 u22.x86_64.pg15 : postgresql-15-pg-ducklake postgresql-15-pg-ducklake_1.0.0-1PIGSTY~jammy_amd64.deb
| PIGSTY 1.0.0 u22.x86_64.pg14 : postgresql-14-pg-ducklake postgresql-14-pg-ducklake_1.0.0-1PIGSTY~jammy_amd64.deb
|
| u22.aarch64 | PIGSTY 1.0.0 u22.aarch64.pg18 : postgresql-18-pg-ducklake postgresql-18-pg-ducklake_1.0.0-1PIGSTY~jammy_arm64.deb
| PIGSTY 1.0.0 u22.aarch64.pg17 : postgresql-17-pg-ducklake postgresql-17-pg-ducklake_1.0.0-1PIGSTY~jammy_arm64.deb
| PIGSTY 1.0.0 u22.aarch64.pg16 : postgresql-16-pg-ducklake postgresql-16-pg-ducklake_1.0.0-1PIGSTY~jammy_arm64.deb
| PIGSTY 1.0.0 u22.aarch64.pg15 : postgresql-15-pg-ducklake postgresql-15-pg-ducklake_1.0.0-1PIGSTY~jammy_arm64.deb
| PIGSTY 1.0.0 u22.aarch64.pg14 : postgresql-14-pg-ducklake postgresql-14-pg-ducklake_1.0.0-1PIGSTY~jammy_arm64.deb
|
| u24.x86_64 | PIGSTY 1.0.0 u24.x86_64.pg18 : postgresql-18-pg-ducklake postgresql-18-pg-ducklake_1.0.0-1PIGSTY~noble_amd64.deb
| PIGSTY 1.0.0 u24.x86_64.pg17 : postgresql-17-pg-ducklake postgresql-17-pg-ducklake_1.0.0-1PIGSTY~noble_amd64.deb
| PIGSTY 1.0.0 u24.x86_64.pg16 : postgresql-16-pg-ducklake postgresql-16-pg-ducklake_1.0.0-1PIGSTY~noble_amd64.deb
| PIGSTY 1.0.0 u24.x86_64.pg15 : postgresql-15-pg-ducklake postgresql-15-pg-ducklake_1.0.0-1PIGSTY~noble_amd64.deb
| PIGSTY 1.0.0 u24.x86_64.pg14 : postgresql-14-pg-ducklake postgresql-14-pg-ducklake_1.0.0-1PIGSTY~noble_amd64.deb
|
| u24.aarch64 | PIGSTY 1.0.0 u24.aarch64.pg18 : postgresql-18-pg-ducklake postgresql-18-pg-ducklake_1.0.0-1PIGSTY~noble_arm64.deb
| PIGSTY 1.0.0 u24.aarch64.pg17 : postgresql-17-pg-ducklake postgresql-17-pg-ducklake_1.0.0-1PIGSTY~noble_arm64.deb
| PIGSTY 1.0.0 u24.aarch64.pg16 : postgresql-16-pg-ducklake postgresql-16-pg-ducklake_1.0.0-1PIGSTY~noble_arm64.deb
| PIGSTY 1.0.0 u24.aarch64.pg15 : postgresql-15-pg-ducklake postgresql-15-pg-ducklake_1.0.0-1PIGSTY~noble_arm64.deb
| PIGSTY 1.0.0 u24.aarch64.pg14 : postgresql-14-pg-ducklake postgresql-14-pg-ducklake_1.0.0-1PIGSTY~noble_arm64.deb
|
| u26.x86_64 | PIGSTY 1.0.0 u26.x86_64.pg18 : postgresql-18-pg-ducklake postgresql-18-pg-ducklake_1.0.0-1PIGSTY~resolute_amd64.deb
| PIGSTY 1.0.0 u26.x86_64.pg17 : postgresql-17-pg-ducklake postgresql-17-pg-ducklake_1.0.0-1PIGSTY~resolute_amd64.deb
| PIGSTY 1.0.0 u26.x86_64.pg16 : postgresql-16-pg-ducklake postgresql-16-pg-ducklake_1.0.0-1PIGSTY~resolute_amd64.deb
| PIGSTY 1.0.0 u26.x86_64.pg15 : postgresql-15-pg-ducklake postgresql-15-pg-ducklake_1.0.0-1PIGSTY~resolute_amd64.deb
| PIGSTY 1.0.0 u26.x86_64.pg14 : postgresql-14-pg-ducklake postgresql-14-pg-ducklake_1.0.0-1PIGSTY~resolute_amd64.deb
|
| u26.aarch64 | PIGSTY 1.0.0 u26.aarch64.pg18 : postgresql-18-pg-ducklake postgresql-18-pg-ducklake_1.0.0-1PIGSTY~resolute_arm64.deb
| PIGSTY 1.0.0 u26.aarch64.pg17 : postgresql-17-pg-ducklake postgresql-17-pg-ducklake_1.0.0-1PIGSTY~resolute_arm64.deb
| PIGSTY 1.0.0 u26.aarch64.pg16 : postgresql-16-pg-ducklake postgresql-16-pg-ducklake_1.0.0-1PIGSTY~resolute_arm64.deb
| PIGSTY 1.0.0 u26.aarch64.pg15 : postgresql-15-pg-ducklake postgresql-15-pg-ducklake_1.0.0-1PIGSTY~resolute_arm64.deb
| PIGSTY 1.0.0 u26.aarch64.pg14 : postgresql-14-pg-ducklake postgresql-14-pg-ducklake_1.0.0-1PIGSTY~resolute_arm64.deb
|
Build
You can build the RPM / DEB packages for pg_ducklake using pig build:
pig build pkg pg_ducklake # build RPM / DEB packages
Install
You can install pg_ducklake 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_ducklake; # Install for current active PG version
pig ext install -y pg_ducklake -v 18 # PG 18
pig ext install -y pg_ducklake -v 17 # PG 17
pig ext install -y pg_ducklake -v 16 # PG 16
pig ext install -y pg_ducklake -v 15 # PG 15
pig ext install -y pg_ducklake -v 14 # PG 14
dnf install -y pg_ducklake_18 # PG 18
dnf install -y pg_ducklake_17 # PG 17
dnf install -y pg_ducklake_16 # PG 16
dnf install -y pg_ducklake_15 # PG 15
dnf install -y pg_ducklake_14 # PG 14
apt install -y postgresql-18-pg-ducklake # PG 18
apt install -y postgresql-17-pg-ducklake # PG 17
apt install -y postgresql-16-pg-ducklake # PG 16
apt install -y postgresql-15-pg-ducklake # PG 15
apt install -y postgresql-14-pg-ducklake # PG 14
Preload:
shared_preload_libraries = 'pg_ducklake';
Create Extension:
CREATE EXTENSION pg_ducklake;
Usage
Sources: README, v1.0.0 release, project docs
pg_ducklake adds DuckLake tables to PostgreSQL. DuckLake metadata lives in PostgreSQL while table data is stored in Parquet and queried through DuckDB, giving PostgreSQL SQL clients access to lakehouse features such as snapshots, time travel, partitioning, sort keys, and external object storage.
Create A DuckLake Table
CREATE EXTENSION pg_ducklake;
CREATE TABLE events (
id int,
kind text,
ts timestamptz
) USING ducklake;
INSERT INTO events VALUES
(1, 'login', now()),
(2, 'click', now());
SELECT * FROM events ORDER BY id;
Set a table path explicitly when data should live outside the default path:
CREATE TABLE lake_events (
id int,
payload jsonb
) WITH (
ducklake.table_path = 's3://my-bucket/prefix/'
) USING ducklake;
Time Travel
Each commit creates a snapshot. Capture a snapshot id before a change, then query the older state:
SELECT max(snapshot_id) AS before_delete
FROM ducklake.ducklake_snapshot \gset
DELETE FROM events WHERE id = 1;
SELECT * FROM ducklake.time_travel('events'::regclass, :before_delete);
Convert And Load Data
Create DuckLake tables from existing PostgreSQL heap tables or external data readers:
CREATE TABLE row_store AS
SELECT i AS id, 'hello pg_ducklake' AS msg
FROM generate_series(1, 10000) AS i;
CREATE TABLE col_store USING ducklake AS
SELECT * FROM row_store;
CREATE TABLE titanic USING ducklake AS
SELECT * FROM ducklake.read_csv('https://raw.githubusercontent.com/datasciencedojo/datasets/master/titanic.csv');
Inlining, Partitioning, And Maintenance
Small writes are inlined in metadata by default to avoid creating many tiny Parquet files. Tune the row limit or flush explicitly:
CALL ducklake.set_option('data_inlining_row_limit', 100);
SELECT * FROM ducklake.flush_inlined_data('events'::regclass);
Partition and sort tables for pruning and analytics:
CALL ducklake.set_partition('events'::regclass, 'bucket(4, id)', 'month(ts)');
CREATE INDEX ON events USING ducklake_sorted (id, ts);
Run maintenance on demand when automatic background maintenance is not enough:
SELECT * FROM ducklake.merge_adjacent_files('events'::regclass);
CALL ducklake.set_option('expire_older_than', '7 days');
SELECT * FROM ducklake.expire_snapshots();
SELECT * FROM ducklake.cleanup_old_files();
External DuckDB Access
DuckDB clients can attach the same DuckLake metadata:
INSTALL ducklake;
LOAD ducklake;
ATTACH 'ducklake:postgres:dbname=postgres host=localhost' AS my_ducklake
(METADATA_SCHEMA 'ducklake');
SELECT * FROM my_ducklake.public.events;
Caveats
- Version 1.0.0 supports PostgreSQL 14-18.
- The README lists Ubuntu 22.04-24.04 and macOS as source-build targets.
- Cloud credentials are stored through a
ducklake_secretforeign server and per-user mappings; protect those catalog objects like other database secrets. - For incremental heap-to-DuckLake conversion, upstream points to the separate
pg_duckpipeproject.
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.