Developing a Postgres Extension in Rust
summary
A ~1000-line PostgreSQL C extension was rewritten in Rust using the pgrx framework and cargo-pgrx tooling; builds and runs use cargo pgrx run and unit tests use cargo pgrx test across PostgreSQL versions. The project implements a validated SIREN custom data type (I/O, comparison operators, index support) and a checksum via the lune3 crate; compilation is slower (hello build 3–4 minutes, full anonizer ~15 minutes) but runtime performance matches the C version and isolation reduces server crashes to about 1%.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 1:09PostgreSQL extensions why
- 4:27What is an extension
- 6:57C extension limits
- 8:24Why Rust
- 10:12pgrx overview
- 16:36Hello World demo
- 19:25Custom type creation
- 24:49Anonymizer experience
- 28:42Rust challenges
- 30:49Rust extensions future
- 32:54Q&A
related talks
26mCan We Use Rust to Develop Extensions for PostgreSQL?
46mFearless Extension Development With Rust and PGRX
28mBeyond Postgres: Insights about the PostgreSQL Extensibility
26mState of the Postgres Extension Ecosystem
31mPostgres without SQL: Natural language queries using GPT-3 & Rust
21mExtending the horizons of R with Rust
11mPostgres plays Pokémon!
29mPostgres Extensions in Kubernetes
