[][src]Function pgx::htup::heap_getattr

pub fn heap_getattr<T: FromDatum>(
    tuple: &PgBox<HeapTupleData>,
    attno: usize,
    tupdesc: &PgTupleDesc<'_>
) -> Option<T>

Extract an attribute of a heap tuple and return it as a Datum. This works for either system or user attributes. The given attnum is properly range-checked.

If the field in question has a NULL value, we return None. Otherwise, a Some(T)

'tup' is the pointer to the heap tuple. 'attnum' is the attribute number of the column (field) caller wants. 'tupleDesc' is a pointer to the structure describing the row and all its fields.

attno is 1-based