Get Started & Installation
This guide covers installing pg_mooncake (v0.3.0) (which bundles moonlink (v0.0.1) and duckdb_mooncake (v0.0.2)) alongside pg_duckdb (v1.2.0) on PostgreSQL 14, 15, 16, 17, and 18.
1. Install Binary Packages via Pigsty (Recommended)
The fastest way to install pg_mooncake on Linux (el8, el9, el10, d12, d13, u22, u24, u26 across x86_64 and aarch64) is with the pig package manager maintained by PGSTY. See the Download & Availability Matrix for direct package links.
2. Configure postgresql.conf & Enable Extension
pg_mooncake uses PostgreSQL logical replication to stream rowstore changes into Moonlink and uses pg_duckdb to load the bundled mooncake.duckdb_extension binary. Add the following settings to postgresql.conf (or via ALTER SYSTEM):
Restart PostgreSQL (sudo systemctl restart postgresql-18 or pig pg restart), then connect with psql and create the extension:
pg_duckdb 1.2.0 Version GuardDuring CREATE EXTENSION pg_mooncake, the bootstrap SQL script explicitly verifies that pg_duckdb version 1.2.0 is installed in pg_extension. Attempting to install pg_mooncake 0.3.0 against an incompatible pg_duckdb release (such as 1.1.x or 1.3.x) will fail immediately with a clear error message. Always upgrade pg_duckdb and pg_mooncake together.
3. Build from Source (v0.3.0)
To build pg_mooncake 0.3.0, pg_duckdb 1.2.0, duckdb_mooncake v0.0.2, and moonlink v0.0.1 from source:
Prerequisites
- PostgreSQL development packages:
postgresql-server-dev-14through18(orpostgresql17-devel/postgresql18-devel) - C/C++ build toolchain:
cmake,ninja-build,g++orclang,libssl-dev,libcurl4-openssl-dev,liblz4-dev,libzstd-dev,protobuf-compiler(protoc) - Rust toolchain: Rust
1.99.0+(stable) andcargo-pgrx0.19.3:
Clone, Verify Pins & Compile
4. Docker Image (Obsolete)
Obsolete — pending updates and maintenance. PGSTY has not yet published Docker or Kubernetes container images for pg_mooncake 0.3.0. The upstream command below uses the historical mooncakelabs/pg_mooncake image (PostgreSQL 17 with pre-0.3 pg_mooncake) and is retained for reference only.
Next Steps
Create your first USING mooncake columnstore mirror table, run transactional DML, and execute vectorized joins.
Review operational requirements around primary keys, partitioned tables, TRUNCATE, and supported DDL operations.
Step-by-step walkthrough: create a PostgreSQL rowstore table, mirror it into a real-time columnstore table with mooncake.create_table, and run analytical queries.
Operational requirements and current limitations of pg_mooncake (v0.3.0), including primary keys, partitioned tables, TRUNCATE, schema DDL, and unsupported procedures.