Skip to content
NewA calmer, faster ZeroHour
Otherinfo

gopgext builds PostgreSQL extensions from Go with TinyGo

Original title: PostgreSQL Extensions in Go

Hacker News · AIby valyala ()2 min read
AI summary · x-ai/grok-4.7Summaries by Vani AI

The project is experimental and warns a bug in generated code can crash the server or corrupt data.

gopgext turns annotated Go functions into PostgreSQL SQL functions, generating C glue, an install script and a control file via TinyGo. It supports triggers, aggregates, index operator classes, foreign data wrappers and SPI queries, and ports of several contrib modules pass upstream regression tests. The author says it is experimental, the API may change, and generated code runs inside the server.

Key facts
  • A comment directive marks a Go function as a SQL function.
  • Several Go extensions can load in one backend.
  • PostgreSQL errors do not unwind through Go frames.
  • A sibling project, gokm, builds Linux kernel modules from Go the same way.
Explain this AI news with Vani AIWhat was announced, what is new and why it matters, in a new chat

From the original article

2 min read at jespino.github.io

gopgext builds PostgreSQL extensions from plain Go code, using TinyGo. Mark a function with //gopgext:function and it becomes a SQL function: gopgext writes the C glue, the install script and the control file. Experimental gopgext is experimental.

Hacker News · AI

By valyala · jespino.github.io

Read the full article at Hacker News · AI

A short excerpt; the article and its images belong to the publisher. Summary, key facts and assessment above are AI-written from the article and can be wrong.