Snowflake-Labs/pg_lake

pg_lake: Postgres with Iceberg and data lake access

What it solves

pg_lake allows you to use PostgreSQL as a complete lakehouse system. It bridges the gap between traditional database tables and modern data lake formats, enabling you to store, query, and modify data residing in object storage (like S3) using standard SQL, while maintaining transactional integrity.

How it works

It uses a modular architecture consisting of PostgreSQL extensions and a separate process called pgduck_server. When you run queries, the system orchestrates the work between PostgreSQL and DuckDB. PostgreSQL handles the metadata, transactions, and SQL planning, while the high-performance DuckDB engine executes the heavy lifting for data scanning and computation. This separation allows for fast, parallelized queries on external files without compromising the stability of your Postgres instance.

Who it’s for

This project is for data engineers and developers who want to work with large-scale data in formats like Iceberg, Parquet, or JSON without leaving the familiar PostgreSQL environment. It is ideal for teams that need to combine local database tables with external data lake files in a single, transactional SQL interface.

Highlights

  • Full support for creating and modifying Apache Iceberg tables directly from SQL.
  • Seamless integration with object storage (S3) for importing and exporting data in Parquet, CSV, and JSON formats.
  • Ability to combine local heap tables, Iceberg tables, and raw files in the same query.
  • Automatic schema inference for external data sources.
  • High-performance query execution powered by the DuckDB engine.
  • Support for geospatial formats via GDAL and a built-in map type for semi-structured data.

Related

  • Project
  • Project
  • Project
  • Project