2 .\" Title: SPI_register_trigger_data
3 .\" Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
6 .\" Manual: PostgreSQL 18.0 Documentation
7 .\" Source: PostgreSQL 18.0
10 .TH "SPI_REGISTER_TRIGGER_DATA" "3" "2025" "PostgreSQL 18.0" "PostgreSQL 18.0 Documentation"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 SPI_register_trigger_data \- make ephemeral trigger data available in SPI queries
35 int SPI_register_trigger_data(TriggerData *\fItdata\fR)
39 \fBSPI_register_trigger_data\fR
40 makes any ephemeral relations captured by a trigger available to queries planned and executed through the current SPI connection\&. Currently, this means the transition tables captured by an
42 trigger defined with a
43 REFERENCING OLD/NEW TABLE AS
44 \&.\&.\&. clause\&. This function should be called by a PL trigger handler function after connecting\&.
47 TriggerData *\fItdata\fR
51 object passed to a trigger handler function as
56 If the execution of the command was successful then the following (nonnegative) value will be returned:
60 if the captured trigger data (if any) has been successfully registered
63 On error, one of the following negative values is returned:
75 if called from an unconnected C function
78 SPI_ERROR_REL_DUPLICATE
80 if the name of any trigger data transient relation is already registered for this connection