pg_duckdb

active

by DuckDB Labs, MotherDuck and Hydra · since 2024 · also known as pg_duckdb, pgduckdb

PostgreSQL extension that embeds DuckDB's vectorized engine for fast analytics and data-lake queries.

relationalcolumnar / olapextensionopen source (permissive)growing

Overview

pg_duckdb is the official DuckDB extension for PostgreSQL, built by DuckDB Labs with MotherDuck and Hydra. It embeds DuckDB inside the Postgres process so analytical queries over Postgres tables can be executed by DuckDB's columnar, vectorized engine, often orders of magnitude faster than the Postgres executor for scans and aggregations. It can also read and write Parquet, CSV, JSON, Iceberg and Delta Lake files on S3, GCS, Azure and R2, and optionally offload work to MotherDuck. It reached 1.0 in September 2025 and supports current PostgreSQL majors including 18; it complements Postgres for analytics rather than replacing a warehouse.

Strengths & trade-offs

Strengths

  • +DuckDB's vectorized execution accelerates analytical queries on Postgres tables
  • +Query Parquet, Iceberg and Delta Lake on object storage directly from SQL
  • +No data movement to a separate warehouse for moderate analytics
  • +Optional hybrid execution with MotherDuck
  • +Backed by the DuckDB core team

Trade-offs

  • −Analytics still run on the OLTP server and compete for its resources
  • −Not available on most hyperscaler managed Postgres services
  • −Type and function mismatches between DuckDB and Postgres need care
  • −Release cadence slowed after 1.1 (last release December 2025)

Great for

  • +Dashboards and reports directly on Postgres data
  • +Joining Postgres tables with Parquet/Iceberg data in S3
  • +Exporting query results to Parquet for data lakes
  • +Ad-hoc analytics without standing up a warehouse

Think twice for

  • −Petabyte-scale warehousing
  • −High-concurrency BI serving many users
  • −Managed Postgres platforms that do not allow custom extensions

Capabilities

Native or official first-party support · 7 of 25 tracked

✓Transactions
✓Joins
✓Secondary indexes
✓JSON
✓Columnar storage
✓Durable persistence
✓Compression
–Full-text search
–Vector search
–Geospatial
–Change data capture
–Triggers
–Stored procedures
–Materialized views
–TTL / expiry
–Pub/Sub
–In-memory
–Encryption at rest
–Role-based access
–Time travel
–Branching
–Online schema changes
–Streaming ingest
–Offline sync
–Runs in WebAssembly

Scale & consistency

Comfortable data size
Medium · ≤ 10 TB
Horizontal scaling
None
Multi-region
No
Transactions
Full ACID
Consistency
Strong
Schema
Strict
Architecture
Single node, Embedded
Query languages
SQL

Runs inside a single Postgres server; can push compute to MotherDuck for larger data.

Deployment

Self-hosted Vendor-managed cloud Serverless Embedded Edge Kubernetes operator

Ecosystem

compatible withPostgreSQL, S3
apis & protocolsPostgreSQL wire protocol
client languagesC, Java, Python, JavaScript, Go, Rust

Alternatives to pg_duckdb

Compare all→
DuckDBColumnar / OLAP63.7

In-process columnar SQL database: the SQLite of analytics, running inside your app or notebook.

pg-duckdb vs duckdb →
pg_mooncakeColumnar / OLAP11.2

Postgres extension that mirrors tables into Iceberg columnstores for real-time analytics via DuckDB.

pg-duckdb vs pg-mooncake →
HydraColumnar / OLAP3.0

Columnar storage extension for Postgres from Hydra; dormant after the team joined Supabase in 2026.

pg-duckdb vs hydra-columnar →
CitusRelational21.1

Postgres extension that shards tables across nodes for multi-tenant SaaS and real-time analytics.

pg-duckdb vs citus →
ClickHouseColumnar / OLAP69.8

Open-source columnar OLAP database known for very fast aggregations over billions of rows.

pg-duckdb vs clickhouse →
MotherDuckColumnar / OLAP37.7

Serverless cloud data warehouse built on DuckDB, with hybrid local-plus-cloud execution.

pg-duckdb vs motherduck →

pg_duckdb FAQ

What is pg_duckdb?

pg_duckdb is a relational database by DuckDB Labs, MotherDuck and Hydra, first released in 2024. pg_duckdb is the official DuckDB extension for PostgreSQL, built by DuckDB Labs with MotherDuck and Hydra. It embeds DuckDB inside the Postgres process so analytical queries over Postgres tables can be executed by DuckDB's columnar, vectorized engine, often orders of magnitude faster than the Postgres executor for scans and aggregations. It can also read and write Parquet, CSV, JSON, Iceberg and Delta Lake files on S3, GCS, Azure and R2, and optionally offload work to MotherDuck. It reached 1.0 in September 2025 and supports current PostgreSQL majors including 18; it complements Postgres for analytics rather than replacing a warehouse.

Is pg_duckdb open source?

Yes. pg_duckdb is open source. License: MIT License.

Does pg_duckdb support ACID transactions?

Yes. pg_duckdb supports full ACID transactions, with strong consistency.

Does pg_duckdb scale horizontally?

pg_duckdb does not scale horizontally; it runs on a single node, so you scale it up rather than out. It is comfortable at medium scale (≤ 10 TB).

How can I run pg_duckdb?

You can self-host it.

What is pg_duckdb best for?

pg_duckdb is a strong fit for dashboards and reports directly on Postgres data; joining Postgres tables with Parquet/Iceberg data in S3; and exporting query results to Parquet for data lakes. Think twice for petabyte-scale warehousing.

What are the best alternatives to pg_duckdb?

Common alternatives to pg_duckdb include DuckDB, pg_mooncake, Hydra, Citus and ClickHouse. The right choice depends on your workload, scale and hosting; WhichDB's smart match ranks them against your requirements.

How popular is pg_duckdb?

pg_duckdb ranks #226 of 844 databases on the WhichDB Score (14.9/100), and #70 among relational databases. The score combines public adoption signals such as package downloads, GitHub activity, job posts and developer discussion.