Built-in functions

This page documents many of the high level functions, targeted functionality is covered on dedicated sub-sections.

Functions available

Functions available to PL/Rust are defined under the trusted-pgrx directory in lib.rs. User functions in plrust will not compile if they use the unsafe keyword. There are a handful of functions in trusted-pgrx that are declared unsafe; plrust functions cannot use them because they would need an unsafe {} block.

Datum functions

PL/Rust function support for various Datums are documented by pgrx on docs.rs, the source is on GitHub for those interested. There are Datums defined in pgrx that are not included in PL/Rust because they have not been imported by plrust.

AnyNumeric: A plain PostgreSQL NUMERIC with default precision and scale values. This is a sufficient type to represent any Rust primitive value from i128::MIN to u128::MAX and anything in between.

FromDatum and IntoDatum: Provide conversions between pg_sys::Datum and Rust types.

Json and JsonB match the types in PostgreSQL of the same name.

Date: A plain PostgreSQL DATE type without a time component.

Time / TimeWithTimeZone / Timestamp / TimestampWithTimeZone

Range Support In progress