names.PostgresTupleRef {REmbeddedPostgres}R Documentation

Retrieves the field/column names of a Postgres Tuple

Description

This retrieves the names of each of the fields within a Postgres tuple that is involved in a trigger event on a database table due to an INSERTION, DELETION or UPDATE action on that table. In conjunction with tupleValues, tupleTypes and setTupleElements, an R trigger function can access and modify the entries in the tuple.

Usage

names.PostgresTupleRef(ref)

Arguments

ref an object of class PostgresTupleRef that contains the address of a C-level object which stores the record for which a trigger event was generated.

Details

The tuple reference is passed to the R function as a result of a trigger event (INSERT, UPDATE or DELETE action on a table) within Postgres and the trigge function being implemented in the Postgres procedural language plR. Rather than copy the contents of the tuple being modified and passing them to R, we give a reference to the instance of that tuple so that the user can modify it directly before returning it to Postgres. This allows the R function to alter insertions that are pending.

Value

A character vector containing the names of the fields within the Postgres tuple reference by the argument.

Author(s)

Duncan Temple Lang

References

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

See Also

tupleValues, tupleTypes [.PostgresTupleRef

Examples


   names(tup)
   tup[names(tup)]  # tupleValues(tup)