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

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.2
File
embedded_postgres-18.6.2-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
embedded_postgres-18.6.2-py3-none-manylinux_2_31_armv7l.whl Python 3 none Linux glibc 2.31+ ARMv7l Details
embedded_postgres-18.6.2-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.2-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.2-py3-none-macosx_11_0_x86_64.whl Python 3 none macOS 11.0+ x86-64 Details
embedded_postgres-18.6.2-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details

Total release size: 81.3 MB

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

Download URL embedded_postgres-18.6.2-py3-none-win_amd64.whl
Size 17.4 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
55a95bd683932f52d6876ea9b303354d872d4d05eeaa0a402215edb2a373d03e
BLAKE2b-256 checksum
How to use checksums
e72c08567c98c27c44a58cf440ea65778ff94ecfcdf70b7a288105bc72bcf826
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.2-py3-none-manylinux_2_31_armv7l.whl

Download URL embedded_postgres-18.6.2-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
ccd5719ee3a54e397c67a9aee56f8329480cd4997f9e9db893b9464c9454fbd9
BLAKE2b-256 checksum
How to use checksums
edfaf1fcd00931d85a99f5735c2ef27b7f67e269150b3c1f191f6aec4a9fd9c9
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.2-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL embedded_postgres-18.6.2-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
1a0147e51f199e7920de2b23f02d73311dba173e435ed60c2538c370a0ca28c0
BLAKE2b-256 checksum
How to use checksums
ca715f84f49ba8de17453641b1c87a91c97ddc149c9e3951eed98d018749e0c8
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.2-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL embedded_postgres-18.6.2-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
131ae942c183b82b4d859c67183d08a323e060f1ef103ebf90cac8e0b29eb0b1
BLAKE2b-256 checksum
How to use checksums
b23bd3f693c3d0222245ece313838ee7e114390d149964b7b9fb2ac53fe33f60
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.2-py3-none-macosx_11_0_x86_64.whl

Download URL embedded_postgres-18.6.2-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
b4b0a75853c51fb47a8da5dab543acb9a79bad7661b3ce8a83f10e9080bd11ba
BLAKE2b-256 checksum
How to use checksums
2697dbdf386d8f77502dc2063d15487c07d475bbc71eeffa731535292ee8596a
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.2-py3-none-macosx_11_0_arm64.whl

Download URL embedded_postgres-18.6.2-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
a98510b0402f955cd77331b352f7d26b933d6367b0a9ac50c9afc02f1d45a91a
BLAKE2b-256 checksum
How to use checksums
e4b287b49524bf02f73f46e527abe8439c6322560d72f0b5e25d079641124eb5
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.2 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