]> begriffs open source - ai-pg/blob - full-docs/txt/spi-spi-register-trigger-data.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / spi-spi-register-trigger-data.txt
1
2 SPI_register_trigger_data
3
4    SPI_register_trigger_data — make ephemeral trigger data available in
5    SPI queries
6
7 Synopsis
8
9 int SPI_register_trigger_data(TriggerData *tdata)
10
11 Description
12
13    SPI_register_trigger_data makes any ephemeral relations captured by a
14    trigger available to queries planned and executed through the current
15    SPI connection. Currently, this means the transition tables captured by
16    an AFTER trigger defined with a REFERENCING OLD/NEW TABLE AS ...
17    clause. This function should be called by a PL trigger handler function
18    after connecting.
19
20 Arguments
21
22    TriggerData *tdata
23           the TriggerData object passed to a trigger handler function as
24           fcinfo->context
25
26 Return Value
27
28    If the execution of the command was successful then the following
29    (nonnegative) value will be returned:
30
31    SPI_OK_TD_REGISTER
32           if the captured trigger data (if any) has been successfully
33           registered
34
35    On error, one of the following negative values is returned:
36
37    SPI_ERROR_ARGUMENT
38           if tdata is NULL
39
40    SPI_ERROR_UNCONNECTED
41           if called from an unconnected C function
42
43    SPI_ERROR_REL_DUPLICATE
44           if the name of any trigger data transient relation is already
45           registered for this connection