tupleTypes {REmbeddedPostgres}R Documentation

Retrieves the values or the types of a Postgres Tuple's elements.

Description

These functions allow the caller to access the values and descriptions of each of the elements in a Postgres tuple stored internally at the C-level.

Usage

tupleTypes(ref)
tupleValues(ref)

Arguments

ref an object of class PostgresTupleRef that is passed to the R function from a Postgres trigger function invocation and is given as an opaque reference. Such an object is stored as a numeric vector of length 3, and its contents are actually memory addresses that should not be used directly.

Details

These functions call C code that resolves the Postgres objects and perform the appropriate operations by querying the Postgres tables for a description of the tuple.

Value

tupleValues returns a named list containing the values contained in the tuple, having been converted to regular R objects (where possible). The names are the field/column names of the Postgres tuple.
tupleTypes returns a named character vector whose elements are the names of the Postgres data type for the corresponding element in the tuple. The names of the elements are again the field/column names of the Postgres tuple.

Author(s)

Duncan Temple Lang

References

http://www.postgresql.org, http://www.omegahat.org/DBMS/Postgres/R

See Also

[.PostgresTupleRef setTupleElements

Examples


  tupleValues(tup)
  tupleTypes(tup)