PGCon2019 - 1.0.10

PGCon 2019
The PostgreSQL Conference

Speakers
Jeff Davis
Schedule
Day Talks - Day 1 - 2019-05-30
Room DMS 1110
Start time 14:00
Duration 00:45
Info
ID 1322
Event type Lecture
Track Hacking
Language used for presentation English

Deep Postgres Extensions in Rust

postgres-extension.rs

Postgres relies heavily on an extension ecosystem, but that is almost 100% dependent on C; which cuts out developers, libraries, and ideas from the world of Postgres. postgres-extension.rs changes that by supporting development of extensions in Rust. Rust is a memory-safe language that integrates nicely in any environment, has powerful libraries, a vibrant ecosystem, and a prolific developer community.

Rust is a unique language because it supports high-level features but all the magic happens at compile-time, and the resulting code is not dependent on an intrusive or bulky runtime. That makes it ideal for integrating with postgres, which has a lot of its own runtime, like memory contexts and signal handlers. postgres-extension.rs offers this integration, allowing the development of extensions in rust, even if deeply-integrated into the postgres internals, and helping handle tricky issues like error handling. This is done through a collection of Rust function declarations, macros, and utility functions that allow rust code to call into postgres, and safely handle resulting errors.