Quick Start

Get started with pg_mooncake using one of the following methods:

1. Docker Image

Pull and run the pg_mooncake Docker image:

docker pull mooncakelabs/pg_mooncake
docker run --name mooncake-demo -e POSTGRES_HOST_AUTH_METHOD=trust -d mooncakelabs/pg_mooncake

This starts a PostgreSQL 17 instance with the pg_mooncake extension. Connect to it using psql:

docker run -it --rm --link mooncake-demo:postgres mooncakelabs/pg_mooncake psql -h postgres -U postgres

2. From Source

Compile and install the pg_mooncake extension. Supported PostgreSQL versions: 14, 15, 16, and 17.

git submodule update --init --recursive
make release -j$(nproc)
make install

3. Neon Postgres

Enable the extension on Neon Postgres:

SET neon.allow_unstable_extensions='true';
CREATE EXTENSION pg_mooncake;

Before creating your first table, navigate to Cloud Storage to bring your object store bucket. It is not recommended to create a columnstore table locally on Neon.

Creating Your First Table

To create a columnstore table, ensure the pg_mooncake extension is enabled:

CREATE EXTENSION pg_mooncake;

In this case, we will be creating a columnstore table where table is stored locally.

CREATE TABLE user_activity(
    user_id BIGINT,
    activity_type TEXT,
    activity_timestamp TIMESTAMP,
    duration INT
) USING columnstore;

Inspect the directory to find Parquet files and a Delta log folder.

Note: For Neon Postgres users, set up an object store bucket before creating a columnstore table.