Please provide/document a way to create Rust extensions
Describe the problem
I would like to be able to add Rust extensions to postgres to perform complex server-side computations.
Describe alternatives
Host my own PostgreSQL and build a rust extension using one of many documented paths like this
pg_tle is language agnostic and can use any procedural language available on the database instance. If you'd like to use Rust, you'll want to explore PL/Rust https://github.com/tcdi/plrust
@jim-mlodgenski thanks for the link! I was looking at the list of extensions available on RDS, and plrust is not one of them, so I was hoping that pg_tle would somehow enable it, especially considering all AWS support of Rust.
The only relevant available extensions seem to be plcoffee, plls, plperl, plpgsql, pltcl, plv8.
@nyurik I'm interested in this problem as well. I found these slides from AWS re:Invent that lists PL/Rust as a trusted language but it may be jumping ahead of itself, because there's also slide in the TLE segment of the Aurora innovations deep dive video from Dec 2022 re:Invent that says "Coming soon: Rust"
- https://d1.awsstatic.com/events/Summits/reinvent2022/OPN307_NEW-LAUNCH!-Adding-safe-extensions-to-PostgreSQL.pdf
- https://www.youtube.com/watch?v=pzZydB78Eyc
PL/Rust is an active community project that does provide an trusted language handler for PostgreSQL and works well with TLE today. It is a little complex to build and setup, but the PL/Rust community has some documentation on how to do that. https://github.com/tcdi/plrust
@jim-mlodgenski could you link to documentation showing how to use pg_tle with PL/Rust especially when running in an AWS managed database? I can't find any documentation (or even comments) suggesting it's possible, other than your comment here.
I found this blog post:
In this post, we show how to deploy an RDS for PostgreSQL instance with PL/Rust enabled
[...]
PL/Rust also gives developers another language option for writing Trusted Language Extensions for PostgreSQL, allowing Rust-based extensions to be installed directly from a SQL interface.