pgcentralfoundation / pgrx

Build Postgres Extensions with Rust!
Other
3.7k stars 249 forks source link

Teach `#[pg_cast]` how to pass down arguments useful to `#[pg_extern]` #1930

Closed eeeebbbbrrrr closed 3 weeks ago

eeeebbbbrrrr commented 3 weeks ago

The #[pg_cast] macro does two things. It creates a regular UDF and it then generates the appropriate CREATE CAST sql.

Ultimately, the cast is just a function so we should support all the attibutes that #[pg_extern] supports.