Attribute Macro pgrx_macros::pgrx
source · #[pgrx]
Expand description
A helper attribute for various contexts.
§Usage with #[pg_aggregate]
.
It can be decorated on functions inside a #[pg_aggregate]
implementation.
In this position, it takes the same args as #[pg_extern]
, and those args have the same effect.
§Usage for configuring SQL generation
This attribute can be used to control the behavior of the SQL generator on a decorated item,
e.g. #[pgrx(sql = false)]
Currently sql
can be provided one of the following:
- Disable SQL generation with
#[pgrx(sql = false)]
- Call custom SQL generator function with
#[pgrx(sql = path::to_function)]
- Render a specific fragment of SQL with a string
#[pgrx(sql = "CREATE FUNCTION ...")]