Just a small gist to show how you can easily create a Rust shared lib, wrap it with C and call it from PostgreSQL SQL Command.
- Prereq : Tested on Ubuntu 18, GCC, postgresql-server-11, postgresql-dev-11, rustlang
- Create new project Cargo embed and cd embed
- Rename the file src/main.rs to lib.rs
- Add following code
#[no_mangle]
pub extern fn double_input(input: i32) -> i32 {
input * 2