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 later 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 all five targets — manylinux_2_28 x86_64 and aarch64, macosx_11_0 arm64 and x86_64, win_amd64 — 12–17 MB per wheel. Until the first release is tagged, wheels are only available as workflow artifacts from the GitHub Actions runs.

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.0

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.0
File
embedded_postgres-18.6.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
embedded_postgres-18.6.0-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.0-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.27+ ARM64, Linux glibc 2.28+ ARM64 Details
embedded_postgres-18.6.0-py3-none-macosx_11_0_x86_64.whl Python 3 none macOS 11.0+ x86-64 Details
embedded_postgres-18.6.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details

Total release size: 68.3 MB

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

Download URL embedded_postgres-18.6.0-py3-none-win_amd64.whl
Size 17.1 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
32566c4d78318f5b415c5355b01180ef85dd8f454578fe27312ff3655c4c4c2a
BLAKE2b-256 checksum
How to use checksums
16244ac8639418a0e38f6ed6a033dbf1ebc983510ec44ea6f76339b54a75ce3b
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.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL embedded_postgres-18.6.0-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
e02d1fba0b9c9fda61e3c6ea06a9b1ca2e6ac9031308cbe3bbb4ca8d7205dc57
BLAKE2b-256 checksum
How to use checksums
1648ed43726d3a6e6e59f338ec991fa031bd234df68d478ab2817535ec162572
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.0-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL embedded_postgres-18.6.0-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
dcd4445bd93363f55d6c4d2ec06b09416d7b5c3ae7179887f1d8ac0d2dfbdb29
BLAKE2b-256 checksum
How to use checksums
8f21a60fa9c64f8296ed318a88cddc59494aa9026e61005ff8b957ef80f74072
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.0-py3-none-macosx_11_0_x86_64.whl

Download URL embedded_postgres-18.6.0-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
cacbdd5648b97fbfa14e67b40deb35d01a0a5b03e11581b2a5096cdffe70c892
BLAKE2b-256 checksum
How to use checksums
32d4ba266d53114e6f76ad429b6067f82c3b376967e56375a991a8424ca21d2d
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.0-py3-none-macosx_11_0_arm64.whl

Download URL embedded_postgres-18.6.0-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
bd7dfdaffd0a324ce2925350c26996268a0079035857a2cb0184b3e9b6bc5c41
BLAKE2b-256 checksum
How to use checksums
664449242aeec5be1461639aaef37e8bdb9d6ccdec8192a62d0fc9692d6ad445
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.0 This release

5 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