pg_automergev0.1.0

Introduction

A Postgres 18 extension that stores Automerge documents in an automerge column, lets you query them with every jsonb operator, function and index, and merges concurrent writes so that two backends never overwrite each other's changes. It also exposes a document's history (changes, and the state as of earlier heads) and the structure of its rich text (marks and blocks, as Automerge's spans()), and notifies listening backends when a document changes.

The extension does not edit documents and never creates changes. Your backend syncs with its frontends, owns the actor IDs, and persists Automerge saves; Postgres stores them, merges them and makes them queryable. The Design pages are the full specification.

Where to start#

If you want toRead
Install the extension, or run the Docker imageInstall, Docker
Store and query your first documentsQuick start
Keep several backends' replicas up to dateKeeping backends in sync
Look up a function, setting or error codeSQL API, Configuration, Error codes
Size memory, WAL and indexes for productionOperations, Monitoring
Know the costs and pitfalls firstLimitations and gotchas
Update a running deploymentUpdating, Changelog
Understand how it works, and whyDesign overview

Requirements#

  • PostgreSQL 18 (the only supported version).
  • To build: Rust 1.98 and cargo-pgrx 0.19.3 (the exact version of the pgrx crate), both pinned in mise.toml, plus what pgrx needs to build against Postgres (a C toolchain, libclang).
  • CREATE EXTENSION needs a superuser: the extension is not trusted, see Install.

License#

MIT — see LICENSE.