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

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

Total release size: 82.2 MB

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

Download URL embedded_postgres-18.6.3-py3-none-win_amd64.whl
Size 18.3 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
4d8277d743e3e4053d353fd9d8ecfdd89b8df8f0cd67c0ded73ffe538893c3b5
BLAKE2b-256 checksum
How to use checksums
e2a09349561246bcf5da8c58fd1571cc31fb003012b349a31f7bb22054437eb4
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.3-py3-none-manylinux_2_31_armv7l.whl

Download URL embedded_postgres-18.6.3-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
256031b561caa1e32247fc8a980d57eb614f4989b210a5c6ad45a72ece2fcc9e
BLAKE2b-256 checksum
How to use checksums
e3d475d9ed75f44c35775b9d35f18e74c2b5f5ac84c7ae68a85575aa1c94fc2e
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.3-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL embedded_postgres-18.6.3-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
321a60b1875b9f1c1856c421ab20dd011d9d5cb58beba8de6551534e64643f65
BLAKE2b-256 checksum
How to use checksums
6958ff37c85dfd216c6f35c97b87df4eccbbd336ed6d07efd4ea6c19befa01c2
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.3-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL embedded_postgres-18.6.3-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
11811184c07cd042db3d384217f2c0c87d90c8abb5aed326119777b76298e034
BLAKE2b-256 checksum
How to use checksums
6219e1f49bed83c39bc82846c2cabdfe0034c42e35fc6474f331bb42707d6bc0
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.3-py3-none-macosx_11_0_x86_64.whl

Download URL embedded_postgres-18.6.3-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
49d00adef73bf29d310faae6f39fc95e47ab4d490246f867a7eeffaff9342e9e
BLAKE2b-256 checksum
How to use checksums
e6a3578dc64d98b01d68e415c74915126ea25f60f0f5a7272de514ab6ef17de9
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.3-py3-none-macosx_11_0_arm64.whl

Download URL embedded_postgres-18.6.3-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
1e1eed1eda17238e64a99031edc404b051caa2ea752361f4826633e3a5ecc702
BLAKE2b-256 checksum
How to use checksums
c97280077b3642a8563e923d743310b9153aef74144945656ee773e13bab1251
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.3 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