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 to | Read |
|---|---|
| Install the extension, or run the Docker image | Install, Docker |
| Store and query your first documents | Quick start |
| Keep several backends' replicas up to date | Keeping backends in sync |
| Look up a function, setting or error code | SQL API, Configuration, Error codes |
| Size memory, WAL and indexes for production | Operations, Monitoring |
| Know the costs and pitfalls first | Limitations and gotchas |
| Update a running deployment | Updating, Changelog |
| Understand how it works, and why | Design overview |
Requirements#
- PostgreSQL 18 (the only supported version).
- To build: Rust 1.98 and
cargo-pgrx0.19.3 (the exact version of thepgrxcrate), both pinned inmise.toml, plus what pgrx needs to build against Postgres (a C toolchain, libclang). CREATE EXTENSIONneeds a superuser: the extension is not trusted, see Install.
License#
MIT — see LICENSE.