Skip to main content

embedded-postgres

PostgreSQL server binaries as a pip-installable wheel, plus a small Python layer that runs initdb, starts and stops the server, and hands you a connection URI. No system PostgreSQL, no root, no Docker.

import embedded_postgres

with embedded_postgres.get_server("/path/to/pgdata") as pg:
    uri = pg.get_uri()          # postgresql://postgres:@localhost:PORT/postgres
    pg.psql("create extension vector")

Status

Early. This project started on 2026-09-07 as a fork of pgserver, which had stopped at PostgreSQL 16.2 in mid-2024. The goals that justify a separate project:

  • current PostgreSQL (18.6 today), with minor releases picked up as they ship;
  • Linux aarch64 and armv7l wheels next to x86_64, macOS and Windows;
  • one wheel per platform (py3-none-<platform>) instead of one per Python version;
  • contrib modules such as pg_stat_statements shipped alongside pgvector.

Current state (2026-09-07): PostgreSQL 18.6 + pgvector 0.8.6 build and pass the test suite on six targets — manylinux_2_28 x86_64 and aarch64, manylinux_2_31 armv7l (32-bit Raspberry Pi OS bullseye or newer; runs the dependency-free smoke test instead of the full suite), macosx_11_0 arm64 and x86_64, win_amd64 — 11–17 MB per wheel. Releases go to GitHub Releases and PyPI: pip install embedded-postgres.

Windows and Administrator accounts

PostgreSQL's tools refuse to run with Administrator rights: initdb, pg_ctl and postgres re-launch themselves with a restricted token in which the Administrators group is deny-only. Any directory that is reachable only through that group is then invisible to them — including the binaries themselves. Since CPython 3.12.4, tempfile.mkdtemp() on Windows creates exactly such directories (SYSTEM, Administrators and the owner; for an administrator the owner is Administrators). Symptom:

invalid binary "...\embedded_postgres\pginstallin\initdb.exe": Permission denied
initdb: error: program "postgres" is needed by initdb but was not found in the same directory as "initdb"

If you run as Administrator, keep the package and the data directory out of mkdtemp()-created trees, or grant your user an explicit ACE (icacls <dir> /grant "%USERNAME%:(OI)(CI)F" /T). Regular user accounts and directories created with os.mkdir() / python -m venv are unaffected.

Versioning

The package version mirrors the bundled PostgreSQL release: MAJOR.MINOR are PostgreSQL's, the third number counts this package's own revisions for that PostgreSQL version. 18.6.0 is the first packaging of PostgreSQL 18.6.

How it is built

pgbuild/Makefile downloads the official PostgreSQL source tarball and pgvector, builds world-bin (server, client tools and contrib, no docs) with configure && make, and installs the result into src/embedded_postgres/pginstall/. cibuildwheel runs that build once per platform in CI and packages the tree into a wheel. Nothing is compiled on the user's machine.

Configure flags: --without-readline --without-icu. No OpenSSL — the server is meant to listen on localhost or a Unix socket.

License

Apache License 2.0 for this project's own code. The bundled PostgreSQL and pgvector binaries are distributed under the PostgreSQL License. See NOTICE and THIRD_PARTY_NOTICES.md.

Metadata

Release files for embedded-postgres 18.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for embedded-postgres 18.6.1
File
embedded_postgres-18.6.1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
embedded_postgres-18.6.1-py3-none-manylinux_2_31_armv7l.whl Python 3 none Linux glibc 2.31+ ARMv7l Details
embedded_postgres-18.6.1-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
embedded_postgres-18.6.1-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64, Linux glibc 2.27+ ARM64 Details
embedded_postgres-18.6.1-py3-none-macosx_11_0_x86_64.whl Python 3 none macOS 11.0+ x86-64 Details
embedded_postgres-18.6.1-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details

Total release size: 81.0 MB

Release files / embedded_postgres-18.6.1-py3-none-win_amd64.whl

Download URL embedded_postgres-18.6.1-py3-none-win_amd64.whl
Size 17.1 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
2fce00f159add31de2aa7c694c6c75f743ebdc188bdb853fa3b4a40bef31bb2d
BLAKE2b-256 checksum
How to use checksums
a4d5656c163b23d1bbf3c4f12fbee3c0daf1e73fe4aeebc232d12875bfd2ba0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

Release files / embedded_postgres-18.6.1-py3-none-manylinux_2_31_armv7l.whl

Download URL embedded_postgres-18.6.1-py3-none-manylinux_2_31_armv7l.whl
Size 12.7 MB
Tags Linux glibc 2.31+ ARMv7l Python 3
SHA-256 checksum
How to use checksums
a4a7131740a4ef1fe49c0c99580e80725ff0d832ce7b05d96a2baa11a13d1425
BLAKE2b-256 checksum
How to use checksums
5cedfdf6a83aadb145dd0f4ca32f92014db48eeb25dde0c2d2bf15d5d1c33b2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

Release files / embedded_postgres-18.6.1-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL embedded_postgres-18.6.1-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 13.6 MB
Tags Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
08ec12c8a3af7c7300f4b7dbebe584a5b70442eaaecbf270e79742fc771382cf
BLAKE2b-256 checksum
How to use checksums
14e31201be7939699973955655adc513adc0115979947169d91eab6f8063e889
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

Release files / embedded_postgres-18.6.1-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL embedded_postgres-18.6.1-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Size 13.6 MB
Tags Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
c87015ff07d56a587715e18981a2b3af6edd2066b66b78dd4e4ebd5c0368adc0
BLAKE2b-256 checksum
How to use checksums
3c04d914047243c31a37e9d9fe94cbbeca5b7e11be74d53845c1bad0dc9fd755
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

Release files / embedded_postgres-18.6.1-py3-none-macosx_11_0_x86_64.whl

Download URL embedded_postgres-18.6.1-py3-none-macosx_11_0_x86_64.whl
Size 12.3 MB
Tags Python 3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
eafd0b23c901db138a255b0fa14212ec0b7f7ef213d27dcc81d4e05d3c3a886d
BLAKE2b-256 checksum
How to use checksums
9e4938e853ed666e15ee1a95b6782b71d595e7e886b3a1e8f1d7b51d2949c98c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

Release files / embedded_postgres-18.6.1-py3-none-macosx_11_0_arm64.whl

Download URL embedded_postgres-18.6.1-py3-none-macosx_11_0_arm64.whl
Size 11.8 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e6744110a538ee24f7e32c7fe31d25ad1445e558cec0c30406df950e1d814b32
BLAKE2b-256 checksum
How to use checksums
b222c03b16a003d0950117ed0b1968f93e71ee87ee9acc60c663817aa59adfc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

18.6.1 This release

6 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page