pg_duckdb
DuckDB Embedded in Postgres
Repository
duckdb/pg_duckdb
https://github.com/duckdb/pg_duckdb
Source
pg_duckdb-1.1.1.tar.gz
pg_duckdb-1.1.1.tar.gz
Overview
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 2430 | pg_duckdb | No | Yes | Yes | Yes | No | No | public |
| Related | pg_mooncake pg_ducklake duckdb_fdw pg_parquet pg_lake pg_clickhouse aws_s3 file_fdw pg_bulkload columnar |
|---|---|
| Depended By | pg_mooncake |
conflict with duckdb_fdw
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.1.1 | 1817161514 | pg_duckdb | - |
| RPM | PIGSTY | 1.1.1 | 1817161514 | pg_duckdb_$v | - |
| DEB | PIGSTY | 1.1.1 | 1817161514 | postgresql-$v-pg-duckdb | - |
Build
You can build the RPM / DEB packages for pg_duckdb using pig build:
Install
You can install pg_duckdb directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Install
pig
dnf
apt
Preload:
Create Extension:
Usage
| Topic | Description |
|---|---|
| Functions | Complete reference for all available functions |
| Syntax Guide & Gotchas | Quick reference for common SQL patterns and things to know |
| Types | Supported data types and type mappings |
| Extensions | DuckDB extension installation and usage |
| Settings | Configuration options and parameters |
| Transactions | Transaction behavior and limitations |
Quick Setup
Install pg_duckdb with pig:
Edit postgresql.conf, then restart to take effect
Accelerate Query
You can use DuckDB to query existing PostgreSQL table without modifying them:
The result would be 8s -> 4s on 4c VM on local laptop) :
Data Lake
Let’s play with a local minio instance:
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)