Tech

Microsoft open sources pg_durable to embed durable execution in PostgreSQL

The preview release brings fault-tolerant background processing directly into the database, aligning with the company’s strategy to keep compute close to data.

Author
Owen Mercer
Markets and Finance Editor
Published
Draft
Source: Hacker News · original
Tech
No image available
New extension allows long-running SQL workflows to survive crashes without external infrastructure

Microsoft has open sourced pg_durable, a PostgreSQL extension designed to enable long-running, fault-tolerant SQL functions. The project allows development teams to define complex workflows directly in SQL, with the system automatically checkpointing each step to ensure execution can resume after crashes, restarts, or individual step failures.

By embedding durable execution capabilities within the database engine, the extension aims to eliminate the reliance on external background workers, message queues, or manual status tables for reliable background processing. Built using Rust and the pgrx framework, pg_durable runs entirely inside the PostgreSQL server, registering a background worker to execute function graphs durably without requiring additional service infrastructure.

The tool exposes a SQL domain-specific language for building these function graphs. For steps requiring arbitrary code, non-HTTP SDKs, or rich in-memory control flow, logic must be wrapped in SQL functions, exposed via HTTP endpoints, or handled by a general-purpose orchestrator. This approach supports Microsoft’s stated mission to bring compute close to data, allowing teams that already store state in Postgres to manage background work more reliably.

Tagged releases are currently available in preview, supporting PostgreSQL versions 17 and 18 on amd64 architectures. Debian packages are provided for installation, which include the extension library, control file, and SQL upgrade files. The project also offers a VS Code Dev Container with Rust and PostgreSQL 17 pre-installed to facilitate local development and testing.

Security and access control are managed through row-level security, ensuring users can only view and manage their own durable function instances. The extension does not send telemetry to Microsoft and has adopted the Microsoft Open Source Code of Conduct. Administrators must explicitly grant privileges to application roles after installation, as the CREATE EXTENSION command does not grant any permissions to PUBLIC by default.

Continue reading

More from Tech

Read next: Apple opens developer access to iOS, iPadOS and macOS 27 betas
Read next: Apple confirms macOS 27 Golden Gate requires Apple Silicon, ending Intel support
Read next: Apple unveils watchOS 27 with Siri AI integration and hardware restrictions