Skip to content

Versions and Cache ​

Versions ​

bash
pgembed versions                        # newest version of each major
pgembed versions --major 17             # every 17.x
pgembed versions --platform linux-musl-x64
snippet source | anchor

The version list comes from Maven Central and is cached for 24 hours; --refresh checks now. Offline, the cached list is used with a warning. Version specs work everywhere a version is taken: exact (17.6.0), major (17, 9.6), minor (17.6) or latest.

Minimal binaries ​

Each version is the PostgreSQL server and the two programs that run it: postgres, initdb and pg_ctl. There are no client tools (psql, pg_dump) and no installer; pgembed sql is the client. The standard extensions (contrib) are included, so CREATE EXTENSION works for pgcrypto, hstore, pg_trgm and the rest; pgembed extensions <version> lists them.

PlatformDownload per version
Linux x64 and arm64, glibc or musl (Alpine)about 14 MB
Windows x64about 24 MB
macOS x64 and arm6430 to 70 MB (newer versions are larger)
For comparison: the official postgres Docker image154 MB, or 112 MB for Alpine

A version downloads once into the cache and is shared by every instance of it, and by your tests.

Install ahead of time and extensions ​

bash
pgembed install 17                      # download ahead of time, for example in a Docker build or CI cache step
pgembed extensions 17                   # what CREATE EXTENSION can use in that version
snippet source | anchor

Cache and diagnostics ​

bash
pgembed cache list                      # installs and downloads, with sizes and what is in use
pgembed cache clean --keep-latest --dry-run
pgembed doctor || true                  # platform, user, Maven, cache folder, port 5432
snippet source | anchor

cache clean never removes a version a running instance uses. doctor checks what Postgres needs: the platform, not running as root, Maven reachable, the cache folder writable and usable by Postgres, and port 5432 free; it exits 1 when a check fails.

The cache is shared with MysticMind.PostgresEmbed: a version installed by pgembed is not downloaded again by your tests, and the other way round. Where it lives is in Configuration.

Released under the MIT License.