Minipg packages PostgreSQL into a single executable, enabling users to manage databases as self-contained `.pgdb` directories. Each `.pgdb` directory includes the database's data, configuration, credentials, and the specific PostgreSQL version. This design allows for easy portability and eliminates the need for traditional server configuration.
A server automatically starts when a command requires it and stops when idle. Commands like `minipg app.pgdb` open a psql shell, while `minipg app.pgdb "select 1"` executes a single statement. The `.pgdb` directory can be copied like any other directory when stopped.
Minipg embeds Docker Hub's `postgres:18-alpine` image and executes it using h9, a Zig library. h9's Linux personality runs Alpine's native Postgres binaries directly on the host's hypervisor. This approach bypasses the need to boot a Linux kernel, use a VM image, or rely on Docker, streamlining the execution environment.
For continuous integration (CI) environments, the Linux binary is static and requires no special privileges or devices. Without `/dev/kvm`, h9 runs Postgres on its native backend. This allows for minimal test jobs, such as `minipg init test.pgdb` followed by `minipg run test.pgdb -- go test ./...`, simplifying database setup for automated testing.
Each `.pgdb` instance is managed by exactly one process, enforced by a lock, which holds the server's h9 machine. This machine's Linux root is the unpacked image, and its writable working directory is the `.pgdb`. Postgres tools like psql and pg_dump run in their own short-lived h9 machines, sharing the same root.
A web-based demo of minipg is available, requiring JavaScript Promise Integration (supported by Chrome and Edge from version 137). The demo runs minipg's Linux build within the Postgres image itself, starting Postgres as ordinary processes and serving on a Unix socket, as web pages lack TCP access. New databases are created from a template cluster to avoid the longer `initdb` process in a web environment.
✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →
One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.
One email a day. Unsubscribe in one click, any time.
Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.
▶ Play today's briefNew every morning, and the back catalogue is archived by date.
Minipg is a new tool that bundles PostgreSQL into a single executable, allowing databases to be managed as simple `.pgdb` directories without server configuration. It embeds a Docker Hub Postgres image and runs it directly on the host's hypervisor using h9, eliminating the need for a Linux kernel, VM, or Docker. This simplifies local development, testing, and CI workflows by providing an isolated, portable PostgreSQL instance.