Back to browse
GitHub Repository

Single process PostgreSQL in vlang (experimental)

3 starsC

Vpg – Pglite for Native Code

by adsharma·May 8, 2026·1 point·0 comments

AI Analysis

●●SolidWizardryNiche Gem

Single-process Postgres via SPI that actually avoids spawning a postmaster daemon.

Strengths
  • Calls InitStandaloneProcess directly to bypass the multi-process postmaster architecture.
  • Custom DestReceiver captures query results into memory buffers instead of stdout.
  • Wraps PG_TRY/PG_CATCH blocks to propagate Postgres errors as native Vlang errors.
Weaknesses
  • Requires building Postgres from source as a submodule before the wrapper even compiles.
  • No concurrency support since it runs in single-user mode; one query blocks the process.
Target Audience

Systems programmers, embedded developers, Vlang enthusiasts

Similar To

pglite · libsql · sqlite

Post Description

Previously I called pgembed, pglite for native code here: <https://news.ycombinator.com/item?id=47726489>.

However that's not true. pglite runs as a single process inside the browser leveraging postgres single user mode.

pgembed gives you the illusion of being an embedded database, but really its running a managed multi-process postgres behind the scenes.

vpg is trying to mimic what pglite does. It's mostly written in C with the top level glue code written in vlang and exposed via python using a custom bindgen implementation.

Similar Projects