6 min read
|
Saved February 14, 2026
|
Copied!
Do you care about this?
pg_lake allows Postgres to manage Iceberg tables and interact with data stored in object storage like S3. It supports transactions, various data formats, and utilizes DuckDB for efficient query execution. Users can create, modify, and query data seamlessly within Postgres.
If you do, here's more
pg_lake integrates Iceberg and data lake files into PostgreSQL, allowing users to treat Postgres as a lakehouse system. It provides full transactional support and fast querying on Iceberg tables while enabling direct interaction with raw data files in storage solutions like S3. Key features include the ability to create and modify Iceberg tables, query data in various formats (Parquet, CSV, JSON), and export query results back to object storage. Users can mix different file types in SQL operations, supporting both structured and semi-structured data.
Setting up pg_lake can be done via Docker for a quick test environment or by building from source for manual setups. After installation, users initialize pg_lake within Postgres by creating necessary extensions with the command `CREATE EXTENSION pg_lake CASCADE;`. pgduck_server, which runs alongside pg_lake, implements the Postgres wire protocol and uses DuckDB for efficient query execution. It listens on port 5332, allowing users to run commands through standard tools like psql.
Creating Iceberg tables is straightforward; users define table structures using the `CREATE TABLE ... USING iceberg` syntax. Data can be imported or exported with the COPY command, supporting various formats and automatically inferring column types from external files. The modular design of pg_lake, built on PostgreSQL extensions and separate services like pgduck_server, enhances maintainability and performance by delegating heavy query tasks to DuckDB while keeping the core Postgres process streamlined. The development team has a strong background in building PostgreSQL extensions, which informs their approach to creating a flexible and efficient system.
Questions about this article
No questions yet.