This release is a pre-release and may not be stable for production use.
PostGamma
PostGamma embeds PostgreSQL 19 directly inside a CPython process. It starts no
database server process, opens no network socket, and exposes ordinary Python
Database and Connection objects backed by a thread-safe in-process kernel.
The wheel contains one CPython extension with the PostGamma kernel linked into
it statically; it does not ship or load a separate libpostgamma.so.
The complete documentation is also available under
docs/ in the source checkout.
Once this alpha is published, install it from PyPI:
python -m pip install "postgamma==0.1.0a1"
import postgamma
cluster = "agent.pgm"
with postgamma.connect(cluster, autocommit=True) as connection:
connection.execute(
"create table if not exists memory("
"id bigint primary key, body jsonb not null)"
)
connection.execute(
"insert into memory values ($1, $2) "
"on conflict (id) do update set body = excluded.body",
[1, {"kind": "plan", "score": 0.98}],
)
print(connection.execute("select * from memory").fetchall())
The first argument may be a string or any os.PathLike object. It names a
PostgreSQL cluster directory, not a DSN or SQL database name. The default
OPEN_OR_CREATE mode initializes a missing PostgreSQL 19 cluster and opens an
existing compatible one without replacing data. PostGamma creates the final
cluster directory; only its parent must already exist. The initial SQL database
is postgres and the initial role is postgamma.
Use OPEN_EXISTING when an absent or misspelled production path must fail:
with postgamma.connect(
"agent.pgm", mode=postgamma.OpenMode.OPEN_EXISTING
) as connection:
print(connection.execute("select current_database()").fetchone())
Repeated top-level calls for the same canonical path share one process-local
embedded instance and return independent sessions. The last connection closes
that implicit instance. Use Database when you want explicit ownership,
management operations, or an instance event stream.
The package includes DB-API 2.0 compatibility, synchronous and caller-driven
asyncio APIs, bounded row and COPY streaming, prepared statements, routed
events, logical dump and restore, management operations, and Arrow C Data
export. Separate connections can execute concurrently without holding the GIL.
Use DB-API 2.0 when an existing framework expects it:
import postgamma
connection = postgamma.connect("agent.pgm")
try:
cursor = connection.cursor()
cursor.execute("select :1::int + :2::int", [20, 22])
print(cursor.fetchone())
finally:
connection.close()
Use the native asyncio facade for event-loop applications. Query progress is driven by native waitables and does not dedicate one Python helper thread per request.
This alpha targets Linux x86-64 with glibc 2.17 or newer and CPython 3.10
through 3.14. It embeds PostgreSQL 19 only. A materialized result is limited to
16 MiB by default and one value to 8 MiB; use row streaming or COPY for larger
workloads. Inherited database handles fail closed after fork(): open lazily
after the fork or call Database.close_before_fork() first.
This release provides the embedded PostgreSQL kernel, its public Python
adapters, and bundled pgvector 0.8.6. Enable vector types and indexes once per
logical database with CREATE EXTENSION vector; no separate native library is
loaded.
Metadata
Release files for postgamma 0.1.0a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 62.5 MB
Release files / postgamma-0.1.0a1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | postgamma-0.1.0a1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 12.5 MB |
| Tags | CPython 3.14 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
d404c7093725cc434aa1af3dee63b5b75f9a5d28a11f899c0adde29710e3b253
|
|
BLAKE2b-256 checksum How to use checksums |
ca165df8d14c07337c0878303557039352854af62d6183a123c7e225501c1786
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 31, 2026.
Transparency logRelease files / postgamma-0.1.0a1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | postgamma-0.1.0a1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 12.5 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
53567bbf883a3a9d58a512492aad4437ea90ed8e2ed31a51cb143c00ba3852a1
|
|
BLAKE2b-256 checksum How to use checksums |
10a85d03e591196042c843277c4f9e1aa252f4194301d22ba6c6f2a6705a93a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 31, 2026.
Transparency logRelease files / postgamma-0.1.0a1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | postgamma-0.1.0a1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 12.5 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
09538029c42cb8016da886b5ed175150f18cdf54cbceea54b576d58200448310
|
|
BLAKE2b-256 checksum How to use checksums |
46536c3cd79eed278e3b91399098cfcf50e7d86ffe91fa9420de0b7d9d8a9641
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 31, 2026.
Transparency logRelease files / postgamma-0.1.0a1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | postgamma-0.1.0a1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 12.5 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
4707c3aca726ce1ea0a6a901ba6a976f8f7922d1aead0ca922100606bc6216e9
|
|
BLAKE2b-256 checksum How to use checksums |
9d6cdeb3e27ffeebb95afdc687c9992897db497314d85079071f54a8fc774cd8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 31, 2026.
Transparency logRelease files / postgamma-0.1.0a1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | postgamma-0.1.0a1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 12.5 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
e30b73ec422304ca9a57eeaf5dd512ac3b88fcd14570d4c94a541c3632bb65c5
|
|
BLAKE2b-256 checksum How to use checksums |
4073a781c5132adcf5ac5fdc684ac0392eeadfdcb17fe68272305c4de3b64fd2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 31, 2026.
Transparency logSecurity for postgamma 0.1.0a1
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.
Full provenance
All 5 files in this release have been uploaded with provenance metadata.
Attestation for postgamma-0.1.0a1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
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 Oct 31, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.