Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Minipg: PostgreSQL as a Single Executable

Article URL: https://progrium.github.io/minipg/ Comments URL: https://news.ycombinator.com/item?id=50650892 Points: 259 # Comments: 39

Minipg is a unique PostgreSQL implementation that operates as a single executable with no server configuration required. Instead of a server, it utilizes a .pgdb directory that contains all the necessary database components such as data, configuration, credentials, and Postgres version. When a command is executed, minipg starts a PostgreSQL shell on the .pgdb, and the server automatically stops when idle.

Minipg embeds the Docker Hub's postgres:18-alpine image and runs it using the Zig library h9. The Linux personality of h9 runs Alpine's own Postgres binaries directly on the host's hypervisor, with h9's Plan 9 kernel handling system calls. This setup eliminates the need for a Linux kernel, VM image, or Docker.

The demo is approximately 35 MB in size and requires JavaScript Promise Integration, which is available in Chrome and Edge from version 137. It can also be opened on its own page. The demo runs minipg's Linux build, which operates within the Postgres image itself, starting Postgres as ordinary processes and serving on a unix socket since a web page lacks TCP.

New databases are created from a template cluster generated during the build process, as initializing the database takes around half a minute on v86. A .pgdb file holds the minipg.toml settings file and the pgdata/ directory, which serves as the Postgres data directory as plain files. Stopped databases can be copied like any other directory.

Minipg has a static Linux binary that requires no privileges or devices, making it compatible with h9's native backend without /dev/kvm. A test job can be as simple as running a single command, and the README lists all available commands with a full guide in the manual. Only one process runs Postgres for a .pgdb, enforced by a lock, which contains the server's h9 machine.

The Linux root is the unpacked image, with the writable working directory being the .pgdb. The image's docker-entrypoint.sh initializes the cluster on the first start.

Commands never host Postgres themselves; instead, they start a new server in the background and use it. psql, pg_dump, and other tools each run in their own short-lived h9 machine, taking about 90 ms to start, over the same root. The source code is available on GitHub under the MIT license. Building minipg requires Zig 0.16 and additional tools like curl, jq, tar, and xz for the root directory.

Currently, minipg is in the early stages, and h9's Linux personality is still young. Users are advised not to rely on it for critical data until bugs are reported and addressed through GitHub issues.

Rewritten by urgent.news; may contain errors — check the original.

Source: progrium.github.io

This story

This is one outlet's version. Read the fullest account.

Every outlet that reported this, and when →

Read the original at progrium.github.io →

Report a problem with this story

More in Tech

[生活] 網銀遭盜轉逾1742萬 刑事局:木馬偽裝短劇App遠端操控手機

先前金管會證實多位民眾在沒有操作APP、也沒有收到OTP密碼之際,網路銀行帳戶卻遭盜轉。對此,刑事局指出截至上週已受理超過100位民眾報案,損失金額超過1,742萬元。分析發現,受害民眾多在下載不明App後疑遭木馬入侵,歹徒即能遠端取得OTP驗證碼並操控網路銀行,進行盜轉。…

More from Thursday, 26 November 2026 →