pg_tle icon indicating copy to clipboard operation
pg_tle copied to clipboard

Please provide/document a way to create Rust extensions

Open nyurik opened this issue 2 years ago • 7 comments

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

nyurik avatar Dec 23 '22 15:12 nyurik

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 avatar Dec 23 '22 16:12 jim-mlodgenski

@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 avatar Dec 23 '22 18:12 nyurik

@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"

  1. https://d1.awsstatic.com/events/Summits/reinvent2022/OPN307_NEW-LAUNCH!-Adding-safe-extensions-to-PostgreSQL.pdf
  2. https://www.youtube.com/watch?v=pzZydB78Eyc

kpamaran avatar Jan 27 '23 04:01 kpamaran

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 avatar Jan 27 '23 14:01 jim-mlodgenski

@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.

seanlinsley avatar Apr 05 '23 18:04 seanlinsley

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.

mogul avatar Dec 09 '23 14:12 mogul