Can We Use Rust to Develop Extensions for PostgreSQL?
summary
Claim: Rust can build real PostgreSQL extensions using the pgrx framework, and the demo extension compiles, installs, and its unit test passes across supported versions. pgrx provides automated SQL generation for functions and operators, a managed dev environment (cargo pgrx init), and integrated testing (cargo pgrx test), but it only supports Postgres 13–17, auto-generates SQL for B-tree/Hash only (no GIN/GiST/SP-GiST), lacks pg_regress integration, and requires learning pgrx memory rules including PgBox to bridge Rust ownership and Postgres MemoryContexts.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 1:15Can we use Rust for Postgres extensions?
- 2:06Why Rust? - Memory safety and security
- 3:41What is pgrx?
- 5:45DEMO: pgrx
- 10:27pgrx: Pros & Cons
- 12:48Requirements for C-Based Extensions
- 16:40Memory management in C/PostgreSQL
- 24:17PostgreSQL & Rust: Core vs. Extensions
- 25:18Summary
related talks
39mDeveloping a Postgres Extension in Rust
46mFearless Extension Development With Rust and PGRX
28mBeyond Postgres: Insights about the PostgreSQL Extensibility
31mPostgres without SQL: Natural language queries using GPT-3 & Rust
26mState of the Postgres Extension Ecosystem
21mExtending the horizons of R with Rust
29mPostgres Extensions in Kubernetes
40mPerformance is a feature: accelerating Postgres
