This is the multi-page printable view of this section.
Release Notes
- 1: pg_mooncake 0.3.4: pg_duckdb 1.2.1+ Support & Direct Upgrades
- 2: pg_mooncake 0.3.3: Durable Snapshot Acknowledgements
- 3: duckdb_mooncake 0.0.5: Durability-Pinned RPC & DuckDB 2.0 CI
- 4: moonlink 0.3.0-pgsty.2: Durable Iceberg Snapshot Acknowledgements
- 5: pg_mooncake 0.3.2: PostgreSQL 15–19, Mirror Generations & Iceberg 0.11
- 6: duckdb_mooncake 0.0.4: Isolated Scan Connections & DuckDB 2.0.1
- 7: moonlink 0.3.0-pgsty.1: Mirror Generations, Iceberg 0.11 & Security Audit
- 8: moonlink 0.3.0: WAL-Free Iceberg Recovery & Hardened CDC
- 9: pg_mooncake 0.3.0: First PGSTY Release with DuckDB 2.0 & PG 14–18
- 10: pg_mooncake 0.2: Columnstore Mirrors & Real-Time Logical Replication
- 11: pg_mooncake 0.1: Native Columnstore Tables & DuckDB Analytics
1 - pg_mooncake 0.3.4: pg_duckdb 1.2.1+ Support & Direct Upgrades
pg_mooncake 0.3.4 removes the rigid exact-version lock on pg_duckdb, accepting pg_duckdb 1.2.1 and later on installation and upgrade while advancing the reference build to pg_duckdb 1.2.2 (embedding DuckDB v2.0.1). It continues to bundle Moonlink v0.3.0-pgsty.2 and duckdb_mooncake v0.0.5, provides direct SQL upgrades from all prior PGSTY 0.3.x releases (0.3.0 through 0.3.3), and has been validated end-to-end across PostgreSQL 15 through 19.
Component Matrix
| Component | Version / Tag | Revision | Notes |
|---|---|---|---|
pg_mooncake |
v0.3.4 |
479f8ec8c2 |
PostgreSQL 15–19 (pgrx 0.20.0, Rust 1.99.1) |
pg_duckdb |
>= 1.2.1 (ref 1.2.2) |
4e921ffbe4 |
Lower-bound SemVer check; reference 1.2.2 and 1.2.1 both embed DuckDB v2.0.1 |
moonlink |
v0.3.0-pgsty.2 |
bae6634bf6 |
Durable Iceberg snapshot acknowledgements; Iceberg 0.11.0, Arrow/Parquet 58.4.2, SQLx 0.9.1 |
duckdb_mooncake |
v0.0.5 |
89413ba02d |
DuckDB v2.0.1 (8d78114e90); per-scan connections & pinned durability RPC |
Summary of Changes
| Area | Change |
|---|---|
pg_duckdb >= 1.2.1 lower bound |
Replaces the exact pg_duckdb = 1.2.1 guard with semantic-version lower-bound enforcement (handling numeric major.minor.patch and prerelease precedence) across installation and upgrade SQL scripts. Both tested pg_duckdb 1.2.1 and 1.2.2 embed DuckDB v2.0.1 and share bundled scanner v0.0.5. Operators choosing a newer pg_duckdb with a different DuckDB engine must verify its PostgreSQL interfaces and supply scanner v0.0.5 built for that engine and platform. |
| Pinned PGXS module version | Adds scripts/pg_duckdb.mk and overrides CPPFLAGS with -DPG_DUCKDB_VERSION from versions.json, rebuilding src/pgduckdb.o whenever pins change so source builds emit the pinned pg_duckdb module version consistently in both Git checkouts and unpacked source archives. |
Direct SQL upgrades (0.3.0–0.3.3) |
Ships direct SQL upgrade scripts 0.3.0--0.3.4, 0.3.1--0.3.4, 0.3.2--0.3.4, and 0.3.3--0.3.4. Existing 0.3.2 and 0.3.3 mirror registrations and generations are preserved while enforcing pg_duckdb >= 1.2.1 and loaded scanner v0.0.5. |
Durable 0.3.0 WAL retirement guide |
Documents how to emit a transactional logical WAL marker and take a verified Iceberg snapshot (flush_lsn) before retiring the legacy 0.3.0 worker’s private _wal directory offline. |
Upgrading to 0.3.4
From 0.3.1, 0.3.2, or 0.3.3
- Install the
pg_mooncake 0.3.4libraries, compatiblepg_duckdb(>= 1.2.1, reference1.2.2), and scannerv0.0.5into your localmooncake.extension_repository, then restart PostgreSQL. - If upgrading from
0.3.1or0.3.2, refresh the cached DuckDB scanner before updating the extension, then open a fresh session so the backend loadsv0.0.5: - In each database with
pg_mooncakeinstalled, updatepg_duckdb(if its installed library changed) and updatepg_mooncake: - If upgrading from
0.3.1or0.3.2, run a freshCALL mooncake.create_snapshot(...)on every mirror before using it as a backup or migration boundary.
From WAL-Based PGSTY 0.3.0
PGSTY 0.3.0 used Moonlink v0.0.1 (b298ef74), which could acknowledge source changes into its private _wal before Iceberg persistence. Perform these steps on every database with mirrors before switching binaries:
- Stop writers to every source table (including remote sources) and take a recoverable backup of both PostgreSQL and the complete Moonlink directory.
- On the old
0.3.0binaries, wait until each mirror matches its quiescent source (comparing all columns in both directions withEXCEPT ALL) and record each mirror’scommit_lsnfrommooncake.list_tables(). For a source on the same PostgreSQL cluster, run both statements in the same autocommit session socreate_snapshotreceives a commit LSN after the last source write:Recheckmooncake.list_tables()and proceed only onceflush_lsncovers the recorded source change (including a delete that emptied a mirror). - Stop PostgreSQL cleanly, move the old
_waldirectory outside the active Moonlink data directory and keep it with your backup (the new worker refuses to start if a nonempty_walremains). - Install the matched
pg_mooncake 0.3.4,pg_duckdb, and scannerv0.0.5, start PostgreSQL, and runALTER EXTENSION pg_duckdb UPDATE TO '1.2.2';(if upgraded) followed byALTER EXTENSION pg_mooncake UPDATE TO '0.3.4';in a fresh session. - Re-verify source/mirror parity, commit one identifiable test change, verify it in the mirror, and take a fresh snapshot before resuming writers. See the full upgrade guide for remote-source details.
Source Release Assets & Checksums
The attached pg_mooncake-0.3.4-source.tar.gz bundles all pinned Git submodules. Verify with sha256sum -c SHA256SUMS (shasum -a 256 -c SHA256SUMS on macOS). See changes since v0.3.3 for the exact commit diff.
| File | Checksum |
|---|---|
| pg_mooncake-0.3.4-source.tar.gz SHA-256 | 0b92e9d2ceb297be4862fc54444b40f585f0a0aceaa96b018de18b89c528e7bb |
| SHA256SUMS SHA-256 | 470812b9d2f53397dc964a3134a3bf08af0475682af54b7ad2c7fe8fbf7aa036 |
Validation
| Platform & Engine | Coverage |
|---|---|
| Linux ARM64 · PostgreSQL 15, 16, 17, 18, 19 | Tested with both pg_duckdb 1.2.1 and pg_duckdb 1.2.2. With 1.2.2, every PostgreSQL major (15–19) passed all 10 pg_regress SQL suites and full integration checks across real server restarts. |
| macOS ARM64 · PostgreSQL 19 | Passed full SQL regression suites and post-restart integration checks. |
| Upgrade matrix | Direct SQL upgrades from all four previous PGSTY versions (0.3.0, 0.3.1, 0.3.2, 0.3.3) exercised end-to-end with existing mirror data. |
2 - pg_mooncake 0.3.3: Durable Snapshot Acknowledgements
pg_mooncake 0.3.3 resolves a snapshot durability bug in CALL mooncake.create_snapshot(...) by upgrading the embedded engine to Moonlink v0.3.0-pgsty.2 and pinning duckdb_mooncake v0.0.5 (verified across Linux and macOS CI).
Prior workers could return from CALL mooncake.create_snapshot(...) before the last source commit had reached Apache Iceberg. After upgrading to 0.3.3 (or 0.3.4), take a fresh snapshot of every mirror before using it as a backup or migration boundary. If an earlier restore differs from the authoritative PostgreSQL source, compare both tables and rebuild the affected mirror as needed.
Component Matrix
| Component | Version / Tag | Revision | Notes |
|---|---|---|---|
pg_mooncake |
v0.3.3 |
e39bb19c71 |
PostgreSQL 15–19 (pgrx 0.20.0, Rust 1.99.1) |
moonlink |
v0.3.0-pgsty.2 |
bae6634bf6 |
Waits for published table commits to persist in Iceberg before acknowledging snapshots |
duckdb_mooncake |
v0.0.5 |
89413ba02d |
Pinned to Moonlink v0.3.0-pgsty.2; verified standalone SQL regression & Alpine/musl CI |
pg_duckdb |
1.2.1 |
451d389a3f |
Embeds DuckDB v2.0.1 (8d78114e90) |
What Changed in 0.3.3
- Durable
create_snapshotacknowledgements: EmbedsMoonlink v0.3.0-pgsty.2, which waits for published table commits to reach Iceberg before answeringCALL mooncake.create_snapshot(...). - Verified scanner
v0.0.5: Pinsduckdb_mooncake v0.0.5, including its standalone SQLLogicTest regression inside the source release archive and matching CI-built binaries verified on Linux and macOS. - Direct SQL upgrades with stale-scanner guard: Adds
sql/pg_mooncake--0.3.0--0.3.3.sql,sql/pg_mooncake--0.3.1--0.3.3.sql, andsql/pg_mooncake--0.3.2--0.3.3.sql. The direct update from0.3.2preserves all existing mirror registration IDs and generations while rejecting a stale loadedv0.0.4scanner.
Upgrading
- From
0.3.1or0.3.2:- Install the matching
pg_mooncake 0.3.3libraries andduckdb_mooncake v0.0.5scanner into the configuredmooncake.extension_repository, then restart PostgreSQL. - Refresh the cached DuckDB scanner in each database:
- Open a fresh session so PostgreSQL loads
v0.0.5, then run: - Take a fresh
CALL mooncake.create_snapshot(...)on each mirror before relying on it for backup or migration.
- Install the matching
- From WAL-based PGSTY
0.3.0: Stop source writes, verify old snapshots against their sources in both directions, preserve the complete storage backup and old_waloffline before starting the new worker, and follow the per-database upgrade procedure.
pg_duckdb 1.2.2?If you want compatibility with pg_duckdb 1.2.1 and newer (including the 1.2.2 reference build), upgrade directly to pg_mooncake 0.3.4.
Source Release Assets & Checksums
Download pg_mooncake-0.3.3-source.tar.gz and SHA256SUMS and verify with sha256sum -c SHA256SUMS (shasum -a 256 -c SHA256SUMS on macOS). The tarball bundles all pinned Git submodules.
| File | Checksum |
|---|---|
| pg_mooncake-0.3.3-source.tar.gz SHA-256 | 4a96f2a7023fac2555760ce055537a7203137526528b9f19626ada1964f24b68 |
| SHA256SUMS SHA-256 | ae4ebac2ff136298837c6d49f2015510c99b729bde8bc1ab42a5ac749da81186 |
Validation & Security Audit
- Reproducible build: Two independent checkouts produced identical source tarballs (
4a96f2a7...). - End-to-end test runs: Fresh installations on PostgreSQL 18.7 (Debian ARM64) — loading the scanner built by GitHub Actions — and PostgreSQL 19.0 (macOS ARM64) each passed 10 SQL regressions, 3 version guards, 15 integration checks, a negative non-restart check, and 2 post-restart checks. Release-mode Cargo checks also passed against PostgreSQL
15,16, and17. - Upgrade verification: A PG19 upgrade from
0.3.2rejected a stalev0.0.4scanner, succeeded after the documented cache refresh, preserved mirror registration IDs and generations, and maintained exact source/mirror parity across new writes, a forced snapshot, and a server restart. - RustSec audit (2026-11-23): Against RustSec
43b5554d9d64ca91c8d0839b7150d4f8ee490cdc,cargo auditfound 0 vulnerability advisories across all three complete lockfiles (pg_mooncake,moonlink, andduckdb_mooncake/moonlink_ffi), reporting 5, 3, and 2 unmaintained-dependency notices respectively (matched by strictcargo denywith no ignores).
3 - duckdb_mooncake 0.0.5: Durability-Pinned RPC & DuckDB 2.0 CI
duckdb_mooncake v0.0.5 targets DuckDB v2.0.1 (8d78114e90) and pins its Rust RPC client (moonlink_ffi) to Moonlink v0.3.0-pgsty.2 (bae6634b), matching the snapshot durability fix shipped in pg_mooncake 0.3.3 and pg_mooncake 0.3.4.
Summary of Changes
| Area | Change |
|---|---|
| Durability-pinned RPC client | Pins moonlink_ffi to Moonlink v0.3.0-pgsty.2 (bae6634b) and bumps EXTENSION_VERSION to v0.0.5, allowing pg_mooncake 0.3.3 and 0.3.4 to enforce that stale v0.0.3 / v0.0.4 scanners are refreshed before upgrading. |
| DuckDB 2.0 CI alignment | Synchronizes the build and formatting workflows (.github/workflows/MainDistributionPipeline.yml, CMakeLists.txt) with the same pinned DuckDB 2.0 maintenance revision used by the extension-ci-tools submodule. |
| Expanded build matrix | Adds Alpine/musl to the GitHub Actions distribution build matrix alongside standard Linux and macOS targets (CI run #45157587099). |
| Standalone SQLLogicTest | Expands test/sql/mooncake.test to load the freshly built mooncake.duckdb_extension directly inside an isolated DuckDB test home, verify loaded extension registration, and exercise ATTACH ... (TYPE mooncake, ...) option validation. |
Pairing & Cache Refresh in PostgreSQL
duckdb_mooncake v0.0.5 is the required scanner for both pg_mooncake 0.3.3 (with pg_duckdb 1.2.1) and pg_mooncake 0.3.4 (which accepts pg_duckdb >= 1.2.1, with reference build 1.2.2, both embedding DuckDB v2.0.1). If an operator deploys pg_mooncake 0.3.4 with a newer pg_duckdb embedding a different DuckDB engine version, build duckdb_mooncake v0.0.5 against that target engine and platform.
When upgrading an existing PostgreSQL cluster from v0.0.3 or v0.0.4:
- Install the updated
mooncake.duckdb_extensioninto the local repository configured bymooncake.extension_repositoryand restart PostgreSQL. - Refresh the cached DuckDB extension in your database:
- Reconnect in a fresh session so PostgreSQL loads
v0.0.5, then runALTER EXTENSION pg_mooncake UPDATE TO '0.3.4';(or'0.3.3').
Standalone DuckDB Usage & Verification
Outside PostgreSQL, a standalone DuckDB v2.0.1 session configured to allow unsigned local extensions can load mooncake.duckdb_extension directly and attach to a running Moonlink Unix socket:
The standalone scanner binary built by GitHub Actions (CI run #45157587099) was verified on both Linux and macOS, including loading inside pg_mooncake integration runs on Debian ARM64 (PostgreSQL 18.7) and macOS ARM64 (PostgreSQL 19.0).
4 - moonlink 0.3.0-pgsty.2: Durable Iceberg Snapshot Acknowledgements
v0.3.0-pgsty.2 ·
Moonlink v0.3.0-pgsty.2 fixes a snapshot durability bug in create_snapshot where a forced snapshot could return before the latest source commit was persisted to Apache Iceberg. This release pairs with pg_mooncake 0.3.3, pg_mooncake 0.3.4, and duckdb_mooncake v0.0.5.
What Was Fixed
In v0.3.0-pgsty.1 (and the underlying v0.3.0 baseline), the replication watermark (replication_lsn) could advance past a source transaction while a mirror’s TableHandler was still processing or flushing an earlier state. When create_snapshot checked only the replication watermark, it could acknowledge completion even though Iceberg still held an older snapshot of that table.
In v0.3.0-pgsty.2 (commits bc99ce4d and bae6634b):
- Table commit watch on
TableHandler:TableHandlernow tracks the table’s published commit watermark (commit_lsn_rx) alongside the replication stream watermark (replication_lsn_rx). - Ordered publication and Iceberg persistence wait:
create_snapshotnow waits until published table commits up through the requested position have actually been persisted to Iceberg before acknowledging the caller. - Release layout regression coverage: Added CDC regression coverage verifying legacy source fingerprints and occupied Iceberg table locations against the PGSTY release on-disk layout.
Action Required After Upgrading
After installing the updated worker (pg_mooncake 0.3.3 or 0.3.4 with Moonlink v0.3.0-pgsty.2), take a fresh snapshot (CALL mooncake.create_snapshot(...)) of each mirror before relying on it as a backup or migration boundary. If an earlier restore already exhibits missing rows, compare the mirror against its authoritative PostgreSQL source and rebuild the affected mirror as needed.
Embedded Rust API Note
Standalone Rust applications constructing a TableHandler directly must now supply the table commit watch (commit_lsn_rx) alongside the replication watch (replication_lsn_rx), as documented in the tagged README:
- Publish the table commit position before enqueueing the table’s commit event.
- Advance the replication position after enqueueing the commit event.
All storage stack versions (Iceberg 0.11.0, OpenDAL 0.58.2, Arrow/Parquet 58.4.2, SQLx 0.9.1, libsqlite3-sys 0.40.0) and the zero-vulnerability RustSec audit posture from v0.3.0-pgsty.1 remain unchanged.
Validation
| Suite | Result |
|---|---|
| Original failing chaos seed | Passed 3/3 consecutive runs after the fix |
Local workspace unit suites (cargo nextest) |
771/771 tests passed |
| PostgreSQL 19 CDC integration suite | 131/131 tests passed, including real server restarts |
| Linux CI pipeline | Run #45153482056 covering chaos, object storage, and PostgreSQL integration |
5 - pg_mooncake 0.3.2: PostgreSQL 15–19, Mirror Generations & Iceberg 0.11
On pg_mooncake 0.3.2, CALL mooncake.create_snapshot(...) can return before Apache Iceberg durably records the last source commit. Upgrade to pg_mooncake 0.3.3 or pg_mooncake 0.3.4 and take a fresh snapshot of each mirror before relying on it for backups or migrations. Compare an already restored mirror with its authoritative PostgreSQL source if its snapshot may have been affected.
pg_mooncake 0.3.2 is the first published GitHub source release after pg_mooncake 0.3.0, consolidating the 0.3.1 platform upgrade milestone (commit 7fa3202a, superseded prior to GitHub Release publication) with mirror lifecycle reconciliation, smart shutdown, reproducible recursive source packaging, and a zero-vulnerability storage stack upgrade.
Component Matrix
| Component | Version / Tag | Revision | Notes |
|---|---|---|---|
pg_mooncake |
v0.3.2 |
4084aaf85c |
PostgreSQL 15–19 (pgrx 0.20.0, Rust 1.99.1) |
moonlink |
v0.3.0-pgsty.1 |
71c9dfcfa8 |
Based on v0.3.0 (dcf999a9f3); Iceberg 0.11.0, Arrow/Parquet 58.4.2, SQLx 0.9.1 |
duckdb_mooncake |
v0.0.4 |
da60e59d96 |
Per-scan isolated Moonlink connections; DuckDB v2.0.1 |
pg_duckdb |
1.2.1 |
451d389a3f |
Embeds DuckDB v2.0.1 (8d78114e90) |
Summary of Changes (Since 0.3.0)
| Area | Change |
|---|---|
PostgreSQL 15–19 & pgrx 0.20.0 |
Upgrades pgrx/cargo-pgrx to 0.20.0 (requiring Rust 1.99.1+), adds PostgreSQL 19 (pg19 feature, TableAmRoutine and planner_hook adaptations), drops PostgreSQL 14 following pgrx policy (PG14 users remain on 0.3.0), and matches PG18 runtime packages to build headers (heap_datum_check). |
| Upstream 0.3 hardening | Absorbs mooncake.data_directory postmaster GUC with moonlink.lock exclusive locking (for pg_basebackup and standbys), planner_hook and ProcessUtility_hook guards rejecting direct DML (INSERT, UPDATE, DELETE, MERGE, TRUNCATE, COPY FROM) and unsupported mirror DDL (RENAME, SET SCHEMA, SET ACCESS METHOD, ATTACH PARTITION, INHERIT), removes mooncake.load_files, adopts native parse_ident keys, and runs the moonlink worker at RecoveryFinished in a signal-isolated thread. |
| Generation-bound mirror lifecycle | Adds mooncake.mirror_registrations, _bind_mirror, _reconcile_drops, pre-commit callbacks, and an sql_drop event trigger. Each mirror binds to the exact Moonlink generation returned by create_table; committed drops and interrupted creations reconcile across restarts without risking a replacement generation. |
| Source-side freshness & smart shutdown | Pairs with duckdb_mooncake v0.0.4 (independent per-scan connections) and source-server WAL watermarks (SOURCE_WATERMARK). Closes Moonlink’s source connections when PostgreSQL enters smart shutdown so local mirrors do not block postmaster drain. |
| Direct upgrades & local scanner | Adds direct SQL upgrade scripts from 0.3.0 and 0.3.1 that check the loaded scanner, bind existing mirrors, and remove mooncake.load_files. Documents local scanner configuration (mooncake.extension_repository + duckdb.allow_unsigned_extensions = on) with duckdb.allow_community_extensions kept off. |
| Zero-vulnerability storage stack | Upgrades to Iceberg 0.11.0, OpenDAL 0.58.2, Arrow/Parquet 58.4.2, and SQLx 0.9.1. The November 23, 2026 RustSec audit found 0 vulnerability and 0 unsoundness matches across all three lockfiles and default graphs (reporting 5, 3, and 2 unmaintained-crate notices for pg_mooncake, moonlink, and scanner FFI respectively). |
| Reproducible source distribution | Ships scripts/source_archive.py and a byte-for-byte reproducible pg_mooncake-0.3.2-source.tar.gz archive containing all pinned submodules (36,086 tracked files) and supporting make pg_duckdb builds without .git metadata. |
Fresh Installation & Configuration
Use pg_config --sharedir for the target PostgreSQL major version and point mooncake.extension_repository to its absolute extension/pg_mooncake subdirectory in postgresql.conf:
duckdb.allow_community_extensions may stay off. Restart PostgreSQL and run CREATE EXTENSION pg_mooncake CASCADE; in a fresh session. If your PostgreSQL data path is non-UTF-8, set duckdb.temporary_directory and duckdb.extension_directory to writable UTF-8 paths.
Upgrading Existing Installations
- From PGSTY
0.3.0(WAL-based worker): Stop source writers, take and verify a snapshot of each mirror on the old binaries, compare source and mirror rows in both directions (EXCEPT ALL), stop PostgreSQL cleanly, and archive the complete storage backup plus the old_waldirectory offline before starting the new worker. - From
0.3.1: Install the matchingv0.0.4scanner into the local repository, refresh the cached scanner viaFORCE INSTALL mooncake FROM ..., reconnect in a fresh session, and runALTER EXTENSION pg_mooncake UPDATE TO '0.3.2';. - Recommended target: Proceed directly to
pg_mooncake 0.3.4(which supersedes0.3.2with thecreate_snapshotdurability fix andpg_duckdb >= 1.2.1support).
Source Release Assets & Checksums
Verify downloads with sha256sum -c SHA256SUMS (or shasum -a 256 -c SHA256SUMS on macOS). The assets below are source distributions; native Linux packages are tracked separately in the PGEXT package matrix.
| File | Checksum |
|---|---|
| pg_mooncake-0.3.2-source.tar.gz SHA-256 | ef5b2b8006ddfdad5b9fd4ad48e485052cf4fb2fcb49cec374c23818aad12d4e |
| SHA256SUMS SHA-256 | f0762e3661ef3c5e7c785acd123a33a637a8ff1f1b2ab2e482a2ab5c7dd1aa24 |
Validation
- Reproducible source archive: Two independent checkouts produced byte-for-byte identical tarballs (
36,086tracked files). Unpacked sources built bothpg_duckdbandpg_mooncakewithout Git metadata and passed full PG19 testing on a fresh cluster. - Runtime matrix: Covered PostgreSQL
15.20,16.16,17.12(Linux ARM64 dev builds), PostgreSQL18.7(Linux ARM64 release), and PostgreSQL19.0(macOS ARM64 release) — passing all 10pg_regresssuites, 3 version guards, 15 integration checks, a negative non-restart check, and 2 checks after a real server restart, plus direct upgrades from0.3.0and0.3.1and MinIO object-storage tests.
6 - duckdb_mooncake 0.0.4: Isolated Scan Connections & DuckDB 2.0.1
The Moonlink worker paired with this scanner (v0.3.0-pgsty.1) can acknowledge a forced snapshot early. Use duckdb_mooncake v0.0.5 with pg_mooncake 0.3.3 or 0.3.4 and Moonlink v0.3.0-pgsty.2, and take fresh snapshots with the updated worker before relying on them for backups or migrations.
duckdb_mooncake v0.0.4 is the first published GitHub Release of the DuckDB storage and catalog scanner after v0.0.2 (rolling in the internal v0.0.3 DuckDB v2.0.1 upgrade at commit 69e0dbb3). It targets DuckDB v2.0.1 (8d78114e90), pins its Rust RPC client to Moonlink v0.3.0-pgsty.1 (71c9dfcf), and pairs with pg_mooncake 0.3.2.
Summary of Changes
| Area | Change |
|---|---|
| Per-scan isolated connections | Refactors MoonlinkClient so every scan opens its own Moonlink Unix-socket stream (Connect()) rather than sharing a single mutex-guarded connection. Two or more concurrent or overlapping scans of the same mirror in one query (such as self-joins or subqueries) no longer collide on server-side ReadState. |
| Automatic read-state cleanup | Each scan releases its server-side read state cleanly when its dedicated stream closes, eliminating lingering state from aborted or overlapping scans. |
DuckDB v2.0.1 & pinned RPC |
Advances the embedded DuckDB baseline from v2.0.0 to DuckDB v2.0.1 (8d78114e90a53823803660bf821f6073ac87da8c) and pins moonlink_ffi to Moonlink v0.3.0-pgsty.1 (71c9dfcf). |
| Extension cache detection | Bumps EXTENSION_VERSION to v0.0.4 in extension_config.cmake so pg_mooncake 0.3.2 can detect and reject an older v0.0.3 scanner still cached in DuckDB’s v2.0.1 extension directory. |
| Build pins & RustSec audit | Pins Corrosion to commit a1a1aaa057, updates CMake policy range to 3.15...3.29, and retains SHA-256-verified nanoarrow 0.7.0 and CRoaring v5.5.4. The 2026-11-23 RustSec audit reports 0 vulnerabilities and 0 unsoundness in moonlink_ffi/Cargo.lock (2 unmaintained-crate notices: RUSTSEC-2025-0141, RUSTSEC-2024-0436). |
Why Per-Scan Connections Matter
Moonlink tracks one active ReadState per (database, table) on each RPC connection between ScanTableBegin and ScanTableEnd. When duckdb_mooncake previously multiplexed all scans through a single shared stream inside MoonlinkClient, queries scanning the same mirror table twice simultaneously (such as SELECT ... FROM mirror a JOIN mirror b ...) could overwrite or prematurely release the sibling scan’s state.
In v0.0.4, each MooncakeScan acquires a dedicated StreamPtr via MoonlinkClient::Connect(), binds its scan snapshot independently, and drops the stream upon completion so Moonlink reclaims temporary scan state automatically.
PostgreSQL Installation & Cache Refresh
For PostgreSQL, use the scanner staged by pg_mooncake inside the configured local DuckDB extension repository (mooncake.extension_repository). When upgrading from scanner v0.0.3 inside an existing DuckDB v2.0.1 cache, refresh the cached scanner and open a fresh PostgreSQL session before running ALTER EXTENSION pg_mooncake UPDATE:
Then reconnect so the backend loads the refreshed binary. For production deployments, upgrade directly to duckdb_mooncake v0.0.5 alongside pg_mooncake 0.3.4. See the duckdb_mooncake Architecture Guide for details.
7 - moonlink 0.3.0-pgsty.1: Mirror Generations, Iceberg 0.11 & Security Audit
v0.3.0-pgsty.1 ·
Moonlink v0.3.0-pgsty.1 can acknowledge a forced snapshot (create_snapshot) before Apache Iceberg persists the last table commit. Upgrade to Moonlink v0.3.0-pgsty.2 (paired with pg_mooncake 0.3.3 or 0.3.4 and duckdb_mooncake v0.0.5) and take a fresh snapshot of each mirror before relying on it for backups or migrations.
Moonlink v0.3.0-pgsty.1 is the PGSTY-hardened storage engine and RPC client paired with pg_mooncake 0.3.2 and duckdb_mooncake v0.0.4. Building on the upstream-aligned v0.3.0 baseline (dcf999a9), this release layers PGSTY commit 71c9dfcf to harden mirror lifecycle management, isolate on-disk storage layout, and upgrade the entire persistence dependency stack to zero RustSec vulnerabilities.
Summary of Changes
| Area | Change |
|---|---|
| Generation-checked lifecycle | Every mirror registration now carries a unique generation token. Stale cleanup requests from a dropped or interrupted create_table call cannot retire a replacement mirror created under the same name. |
| Append-only RPC extensions | Retains all earlier wire request numbers (0–9) and appends 10 Registration, 11 DropRegistration, 12 RegisteredDatabases, 13 CreateRegisteredTable, and 14 ManagedRegistrations, plus SOURCE_WATERMARK (u64::MAX) for source-side WAL freshness. |
| Storage & staging safety | Fixes snapshot metadata for deletion vectors and file indexes; validates safe catalog namespaces/table names (MooncakeTableId::storage_key using v2-<sha256>); isolates write cache under temp/write_cache/v2-<digest>/; stages atomic writes in .moonlink_atomic_tmp without deleting unrelated files; refuses occupied local Iceberg directories and nonempty legacy _wal directories. |
| Persistence stack upgrade | Upgrades to Apache Iceberg 0.11.0, OpenDAL 0.58.2, Arrow & Parquet 58.4.2, SQLx 0.9.1 (libsqlite3-sys 0.40.0), and Inferno 0.12.8 (optional pprof rendering). |
| RustSec security audit | Eliminates all remaining vulnerability and unsoundness advisories across the workspace lockfile and default dependency graph (0 vulnerabilities, 0 unsoundness; 3 unmaintained-crate notices remain). |
Generation-Checked Mirror Management & RPC Wire Protocol
Previously, creating, dropping, and recreating a mirror with the same schema.table name across restarts or aborted DDL transactions could race with delayed cleanup requests. v0.3.0-pgsty.1 introduces explicit registration generations:
CreateRegisteredTablereturns a fresh generation identifier bound into PostgreSQL’smooncake.mirror_registrationscatalog table inside the destination transaction.DropRegistrationrequires both(database, table)and the exactgeneration, ensuring that late retries or orphan reconciliation never delete a newer replacement mirror.RegisteredDatabasesandManagedRegistrationsletpg_mooncakereconcile committed drops and interrupted creations across restarts and guard database renames/drops cleanly.SOURCE_WATERMARK(u64::MAX) instructs Moonlink to sample the mirror’s source server WAL position for freshness-sensitive scans and snapshots, working consistently for both local and remote sources.
All additions are strictly append-only and covered by wire-format golden tests in src/moonlink_rpc/tests/wire_golden.rs and src/moonlink_service/src/schema_wire_golden.rs.
Storage Hardening & Persistence Upgrade
- Clean layout separation: Scratch directories (
temp/,read_through_cache/,.moonlink_atomic_tmp/) are strictly separated from Iceberg table directories (<db>/<schema>.<table>/{data,metadata}), and reserved directory names are rejected as catalog namespaces. Each new local mirror requires an unoccupied Iceberg directory; separate deployments sharing object storage must use exclusive table prefixes. - Deletion vector & index metadata: Fixed snapshot metadata handling for deletion vectors and file indexes, and ensured atomic write staging under
.moonlink_atomic_tmppreserves unrelated files. - Zero-vulnerability audit (2026-11-23): Upgrading to
iceberg 0.11.0,opendal 0.58.2,arrow/parquet 58.4.2, andsqlx 0.9.1(libsqlite3-sys 0.40.0) resolved thequick-xml,thrift,arrow-data, andlibsqlite3-sysadvisories present inv0.3.0. Bothcargo auditand strictcargo deny(with an empty ignore list) reported 0 vulnerabilities and 0 unsoundness matches in Moonlink (reporting only three unmaintained-crate notices:RUSTSEC-2025-0141,RUSTSEC-2026-0543, andRUSTSEC-2024-0436).
Testing & Migration Notes
- Tested against both local filesystem storage and MinIO object storage.
- Migrating from
v0.0.1(pg_mooncake 0.3.0): Stop source writers, take and verify a snapshot of each mirror on the old binaries, compare source and mirror in both directions, stop PostgreSQL cleanly, and preserve the complete storage backup and old_waldirectory offline before starting the new worker. The worker refuses to start if a nonempty_waldirectory remains present. - Recommended target: Deploy
Moonlink v0.3.0-pgsty.2instead ofv0.3.0-pgsty.1to include thecreate_snapshotdurability fix.
8 - moonlink 0.3.0: WAL-Free Iceberg Recovery & Hardened CDC
Moonlink v0.3.0 synchronizes pgsty/moonlink with upstream Mooncake-Labs/moonlink v0.3-dev at commit dcf999a9. It serves as the upstream-aligned 0.3 baseline beneath PGSTY’s hardened engine releases (v0.3.0-pgsty.1 and v0.3.0-pgsty.2).
v0.3.0 preserves the exact upstream v0.3-dev baseline (dcf999a9). For deployments of pg_mooncake 0.3.3 and pg_mooncake 0.3.4, use Moonlink v0.3.0-pgsty.2, which layers generation-checked mirror lifecycle management, zero-vulnerability storage upgrades (Iceberg 0.11 / Arrow 58.4.2 / SQLx 0.9.1), and durable snapshot acknowledgements on top of this baseline.
Summary of Changes
| Area | Change |
|---|---|
| WAL-free Iceberg recovery | Removes Moonlink’s private _wal directory entirely. PostgreSQL replication slot confirmed_flush_lsn is now advanced only up to the minimum LSN persisted into Apache Iceberg across healthy mirrors of that source. |
| Per-table errored isolation | Replaces fatal worker panics with persistent per-table error markers under errored_tables/. An out-of-sync mirror rejects queries with its diagnostic reason while healthy mirrors continue replicating uninterrupted. |
| CDC correctness & schema drift | Stores source table OID, column definitions, and partition topology under source_fingerprints/, polling for schema changes, TRUNCATE, inheritance children, unlogged partitions, and enum renames. Enforces strict type/value fidelity and fixes \\N text copy semantics. |
| Replication recovery & initial copy | Returns from create_table only after the initial copy is durably persisted in Iceberg, speeds up initial-copy row conversion, drops publication entries by relation OID, handles full-disk cancellation and mid-create drops safely, and restores a consistent view when streamed transactions abort or end unapplied. |
| Storage, Iceberg GC & bounds | Adds atomic Iceberg metadata writes, automatic garbage collection of superseded Iceberg files (MOONLINK_ICEBERG_GC), bounded LSN wait (MOONLINK_LSN_WAIT_TIMEOUT_SECS, default 30 s), disk-full backoff (30 min / 512 MiB cap), and bounded write amplification, memory slices, and cache budgets. |
| Scope slimming & RPC stability | Removes unused Delta Lake, DataFusion, REST/Glue catalogs, Kafka, OpenTelemetry, GCS, and Postgres metadata store components; upgrades Arrow/Parquet to 56; pins the append-only moonlink_rpc and moonlink_table_metadata wire format with byte-level golden tests (tests/wire_golden.rs). |
Architectural Highlights
1. Eliminating the Private WAL
In v0.0.1 (shipped with pg_mooncake 0.3.0), Moonlink maintained its own private _wal log and could acknowledge PostgreSQL’s logical replication slot before changes reached Iceberg. In v0.3.0, Moonlink removes _wal completely:
- Iceberg-backed slot advancement:
compute_confirmed_flush_lsnadvances a source database’s replication slot (moonlink_slot_<db>) strictly to the minimum Iceberg-persisted LSN across its healthy mirrors. - Bounded WAL retention: Active mirrors persist at least every ~300 seconds (or sooner as rows accumulate); idle mirrors and errored mirrors do not hold back
pg_wal. - Clean restart recovery: On restart, Moonlink reads
moonlink_metadata_store.sqlite, reloads each mirror from its latest Iceberg v3 snapshot (with Roaring deletion vectors), and replays only unpersisted commits from the PostgreSQL replication slot.
2. Per-Table Fault Isolation & Strict CDC Fidelity
- No cross-table blast radius: Unsupported source DDL (column additions/drops/renames/type changes,
REPLICA IDENTITYchanges away fromFULL,TRUNCATE,INHERITS, dropping/detaching partitions, attaching populated partitions, orROLLBACK TO SAVEPOINTinside streamed transactions exceedinglogical_decoding_work_mem) transitions only the affected mirror into a persistederroredstate instead of crashing the background worker. - Deterministic row-position indexing: Replaces per-restart random hashing seeds with deterministic lookup indices. On the first startup after upgrading, existing mirrors automatically rebuild their lookup indices once from their data files so updates and deletes on previously flushed rows remain accurate across restarts.
- Exact type boundaries: Rejects unsupported source types (
interval,timetz, multi-dimensional arrays,numericprecision > 38, and unrepresentable values such asnumericNaN/Infinityorinfinitydates/timestamps) explicitly instead of silently altering data.
3. Iceberg Garbage Collection & Resource Bounds
- Automatic Iceberg GC: Deletes superseded metadata files, manifests, deletion vectors, and compacted Parquet data files once no active scan references them and neither the current nor previous version needs them. Set
MOONLINK_ICEBERG_GC=dry-runto inspect deletions orMOONLINK_ICEBERG_GC=offto retain historical files. - Bounded waits & disk-full protection: Queries waiting on replication LSNs time out after 30 seconds by default (
MOONLINK_LSN_WAIT_TIMEOUT_SECS) with a retryable error naming both requested and replicated LSNs. When disk space is exhausted, flushes retry cleanly and cap buffered waiting changes at 30 minutes or 512 MiB across all mirrors to protect the PostgreSQL background worker from OOM termination.
Upgrade & Security Notes
- Upgrading from
v0.0.1(pg_mooncake 0.3.0): Becausev0.3.0removes_wal, operators migrating existing mirrors frompg_mooncake 0.3.0must stop source writers, verify mirror parity and flush all changes to Iceberg on the old binaries, and move_waloffline with a full backup before starting any0.3.xworker. - RustSec dependency audit: Removing Delta Lake, DataFusion, Kafka, and OpenTelemetry substantially reduced the dependency tree; the November 22, 2026 RustSec snapshot still matched 22 vulnerabilities in the full
v0.3.0lockfile (primarily transitive dependencies undericeberg 0.7,opendal 0.54,parquet 56, andsqlx-sqlite 0.8). All of those findings were eliminated inMoonlink v0.3.0-pgsty.1.
See the Moonlink Engine Guide and Architecture Overview for full operational details.
9 - pg_mooncake 0.3.0: First PGSTY Release with DuckDB 2.0 & PG 14–18
pg_mooncake 0.3.0 — released alongside duckdb_mooncake v0.0.2 and moonlink v0.0.1 — is the first release of the Mooncake real-time analytics suite maintained by PGSTY:
pgsty/pg_mooncake v0.3.0(MIT)pgsty/duckdb_mooncake v0.0.2(MIT)pgsty/moonlink v0.0.1(BSL-1.1withPG_MOONCAKE LINKING & DISTRIBUTION EXCEPTION, client cratesMIT)
Binary RPM and DEB packages for PostgreSQL 14, 15, 16, 17, and 18 across RHEL / Rocky / AlmaLinux 8, 9, 10 and Debian 12/13, Ubuntu 22.04/24.04 (x86_64 and aarch64) are available through the PGEXT repository and Pigsty.
Highlights of pg_mooncake 0.3.0
1. Upgraded to pgrx 0.19.3 & PostgreSQL 14–18
pg_mooncake has been migrated to pgrx = 0.19.3 (cargo-pgrx 0.19.3), bringing first-class support for PostgreSQL 18 alongside PostgreSQL 14, 15, 16, and 17:
- Updated extension metadata in
pg_mooncake.control(default_version = '0.3.0') and added the upgrade scriptsql/pg_mooncake--0.2.0--0.3.0.sql. - Replaced legacy C string literals with Rust native
CStr(c"...") across GUC definitions (mooncake.timeline_id,mooncake.enable_local_bucket,mooncake.default_bucket,mooncake.enable_memory_metadata).
2. DuckDB 2.0.0 & pg_duckdb 1.2.0 Adaptation
pg_mooncake 0.3.0 embeds pg_duckdb v1.2.0 and duckdb_mooncake v0.0.2, built against DuckDB v2.0.0 (d54cbbe3df17e8e5ce68312f483b4155836112aa):
- Ported
duckdb_mooncaketo the DuckDB 2.0TableCatalogEntry,StorageExtensionInfo, andTableFilterSetiterator APIs. - Fixed column-index remapping for
IS NULLandIS NOT NULLfilter pushdown inMooncakeScanFunction, preventing segmentation faults when multi-column filters are pushed down to Moonlink Parquet scans. - Added a runtime
pg_duckdbversion check during worker initialization that enforcespg_duckdb = 1.2.0(accepting1.2.0or1.2.0-*pre-release suffixes and failing fast with a clear diagnostic message on mismatched versions such as1.1.3or1.3.0).
3. LSN-Consistent Snapshot Reads (pg_current_wal_flush_lsn)
Previously, duckdb_mooncake constructed Moonlink table scan descriptors with lsn = 0, returning immediately without waiting for recently committed PostgreSQL transactions to be ingested by the background logical replication worker.
In v0.3.0, pg_mooncake exports mooncake_get_postgres_lsn() (calling pg_current_wal_flush_lsn() when in a normal backend session and 0 during recovery), and duckdb_mooncake resolves that symbol via dlsym(RTLD_DEFAULT, "mooncake_get_postgres_lsn"). Every analytical query against a columnstore table now waits until Moonlink has caught up to the PostgreSQL WAL flush LSN before scanning.
4. Partitioned Table Hierarchy Support (REPLICA IDENTITY FULL)
When calling mooncake.create_table(dst, src) on a partitioned PostgreSQL table, pg_mooncake 0.3.0 now walks the inheritance tree (find_all_inheritors) and sets REPLICA IDENTITY FULL on both the parent table and every leaf partition before adding the root table to the logical replication publication.
5. Explicit 0A000 Error for Deprecated mooncake.load_files
The legacy v0.1 helper mooncake.load_files(dst TEXT, files TEXT[]) now raises ERRCODE_FEATURE_NOT_SUPPORTED (0A000) with a clear migration message instead of silently panicking (todo!()).
6. Cargo Dependency Security Audit (RustSec)
All three Cargo workspaces (pg_mooncake, moonlink, duckdb_mooncake/moonlink_ffi) underwent a comprehensive security remediation against the RustSec Advisory Database (2026-11-05):
pg_mooncake/Cargo.lock: reduced vulnerabilities from 33 to 6 (-82%) and eliminated all unsoundness warnings (1 -> 0).moonlink/Cargo.lock: reduced vulnerabilities from 46 to 15 (-67%) and eliminated all unsoundness warnings (1 -> 0).duckdb_mooncake/moonlink_ffi/Cargo.lock: 0 vulnerabilities, 0 unsound, 0 warnings.- Upgraded
tonic 0.14.5,prost 0.14.3,bincode 2.1.0,opentelemetry 0.31.0,wasmtime 43.0.1,rustls 0.23.37,aws-lc-rs 1.16.3,bytes 1.11.1,tar 0.4.45, andlz4_flex 0.11.6. See the SBOM & Security Audit page for full details.
Validation Summary
pg_mooncake 0.3.0 was validated end-to-end on both Ubuntu 24.04.5 LTS ARM64 (PostgreSQL 18.6) and Rocky Linux 10.2 ARM64 (PostgreSQL 17.11):
- 58/58 Moonlink
table_handlerunit tests passed. - 3/3
pg_RegressionSQL suites (small,partition,unsupported) passed (0failures). - Runtime version check verified: rejected
pg_duckdb 1.1.3and1.3.0, accepted1.2.0. - 11/11 real-time replication,
UPDATE/DELETE, partition, Iceberg metadata, and crash-restart persistence checkpoints passed.
10 - pg_mooncake 0.2: Columnstore Mirrors & Real-Time Logical Replication
With v0.1, we proved that Postgres can deliver great analytics performance. Our approach combined two key pieces—DuckDB vectorized engine and a columnstore table—making pg_mooncake the only extension in Postgres that integrates both.
The results speak for themselves: pg_mooncake ranks in ClickBench’s top 10, and we built the fastest Parquet-based engine along the way.
Now, with v0.2, we’re tackling the next big challenge; we call it out-of-the-box analytics.
First, why in-Postgres analytics?
Applications often have their first analytics needs far before they have their first data warehouse or analytics system.
We’ve seen this story over and over again. The typical path involves delaying the roadmap, setting up data replication into a separate system, hiring engineers to maintain the pipeline—all while stitching Postgres data with analytics data at the application level.
pg_mooncake eliminates this complexity. With columnstore tables, developers get a native Postgres experience for both transactional and analytical workloads. No separate systems, no complex pipelines—just Postgres.
In v0.2, we are focused on making columnstore tables easier to get started for more workloads. In this blog, we cover the areas under active development:
1. Full Postgres Table Access Method (TAM) for Columnstore Tables (#80)
In v0.1, all columnstore queries ran through DuckDB. This delivered performance, but meant missing Postgres features like data-modifying CTEs (e.g., deleting rows, returning results, and inserting them into another table) and triggers.
In v0.2, we explore exposing columnstore tables through a Postgres table access method and logical replication architecture, allowing DuckDB to serve as the fast execution engine while preserving full Postgres table compatibility.
2. Logical Replication into columnstore tables (#90)
Users often adopt pg_mooncake after encountering slow queries on their existing Postgres tables. With logical replication, we make it even easier to accelerate analytics without changing application write patterns—simply replicate data from heap tables into columnstore tables via mooncake.create_table.
This significantly enhances pg_mooncake’s deployability, no matter where your Postgres is hosted. You can run pg_mooncake alongside your existing Postgres deployments and seamlessly replicate data from heap tables into columnstore tables.
3. Small Inserts with an In-Memory / Rowstore Buffer (#89)
Logical replication introduces a challenge: how do we handle frequent small inserts without generating a new Parquet file and metadata log for every transaction?
In v0.2 (powered by Moonlink), small inserts go into an Arrow write buffer, while background flushes write compacted Parquet files. When querying a columnstore table, duckdb_mooncake scans both the buffered data and Parquet files. Once the buffer exceeds a threshold, it flushes to Parquet. This approach decouples Parquet writes from OLTP transactions, significantly reducing write amplification.
This is a major unlock, making columnstore tables viable for high-concurrency OLTP mirroring without requiring batched inserts—especially for logging, HTAP, and time-series workloads.
So, where does that put us?
pg_mooncake is the easiest way to get fast analytics inside Postgres. With v0.2 (and PGSTY’s v0.3.0 release), key use cases improve even further:
- User-facing analytics with Postgres – Full ORM support, joins with regular Postgres tables, and only 1 system to manage.
- Logs, chat history, time series – Optimized for high-rate ingest with the benefits of Parquet compression and low storage costs.
- Complete Data Lake out of the box – Postgres +
pg_mooncakewriting data transactionally to Apache Iceberg, combined with the fastest Parquet-based execution with file skipping and segment elimination.
11 - pg_mooncake 0.1: Native Columnstore Tables & DuckDB Analytics
We announced pg_mooncake to the world on Day 60.
Today, Day 131, pg_mooncake comes out of beta.
pg_mooncake wins on ease and performance. So, we doubled down for v0.1. That’s it.
The Easiest Way to Fast Analytics in Postgres
With a native columnstore table in Postgres, pg_mooncake brings familiar table semantics to the way you run analytics. Columnstore tables support transactional operations like INSERT, SELECT, UPDATE, DELETE, and COPY, alongside joins with regular Postgres heap tables.
In v0.1, we’ve made it even easier to load data into columnstore tables:
- From Parquet, CSV, and JSON files:
- From Hugging Face datasets:
- From existing Iceberg and Delta Lake tables:
Better performance for time-series workloads
pg_mooncake is the only Postgres extension that adds columnar storage and vectorized execution.
In v0.1, we added file statistics and skipping. Customers run time-series and analytics workloads without traditional sharding.
Our ClickBench results land next week. (Hint: top 10 🙂). Perhaps Postgres is indeed a Great Real-Time Analytics Database.
Looking Ahead to v0.2
We will double down on two areas: DevEx and time-series workloads. Planned improvements include:
- Enhanced support for small writes, updates, and deletes
- Syncing rowstore tables to columnstore tables
- Indexes (secondary indexes and sort keys)
- Time-series functions
To our community, thank you
It takes a village. Thank you to our community, customers, contributors, and Postgres partners like Neon and Supabase. Your support has been invaluable.
Our favorite metric is the number of contributors to pg_mooncake growing.
The momentum behind pg_mooncake is clear. Analytics in Postgres is indeed a reality 🥮