Minipg: PostgreSQL as a Single Executable
Trending on Hacker News: Minipg: PostgreSQL as a Single Executable (280 points / 44 comments, via progrium.github.io)
Opening excerpt
minipg is PostgreSQL as one executable, ready to use, with no server to configure. A .pgdb directory is the database: its data, config, credentials, and Postgres version all live inside it, and minipg app.pgdb opens a psql shell on it. A server starts when a command needs one and stops on its own when it’s idle.
minipg embeds Docker Hub’s postgres:18-alpine image and runs it with h9 , used as a Zig library. h9’s Linux personality runs Alpine’s own Postgres binaries directly on the host’s hypervisor, with h9’s Plan 9 kernel answering their system calls. There’s no Linux kernel to boot, no VM image, and no Docker.
The demo runs minipg’s Linux build, which runs inside the Postgres image itself. It starts Postgres as ordinary processes and serves on a unix socket, since a page has no TCP. New databases come from a template cluster made at build time, because initdb takes half a minute on v86.
minipg app.pgdb # psql shell (creates app.pgdb if missing) minipg app.pgdb “select 1” # one statement minipg url app.pgdb # postgres://postgres:…@127.0.0.1:54321/app minipg serve app.pgdb # an …
(Excerpted from the original; full article via the source link below.)
This story hit the Hacker News front page today (280 points / 44 comments, via progrium.github.io). Our Tech Radar aggregates daily signals on AI engineering, backend architecture and DevOps — browse the related services and further reading below, or get in touch with our team.
Source: Hacker News