]> begriffs open source - ai-pg/blob - full-docs/man3/SPI_register_trigger_data.3
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / man3 / SPI_register_trigger_data.3
1 '\" t
2 .\"     Title: SPI_register_trigger_data
3 .\"    Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
5 .\"      Date: 2025
6 .\"    Manual: PostgreSQL 18.0 Documentation
7 .\"    Source: PostgreSQL 18.0
8 .\"  Language: English
9 .\"
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 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 SPI_register_trigger_data \- make ephemeral trigger data available in SPI queries
32 .SH "SYNOPSIS"
33 .sp
34 .nf
35 int SPI_register_trigger_data(TriggerData *\fItdata\fR)
36 .fi
37 .SH "DESCRIPTION"
38 .PP
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
41 AFTER
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\&.
45 .SH "ARGUMENTS"
46 .PP
47 TriggerData *\fItdata\fR
48 .RS 4
49 the
50 TriggerData
51 object passed to a trigger handler function as
52 fcinfo\->context
53 .RE
54 .SH "RETURN VALUE"
55 .PP
56 If the execution of the command was successful then the following (nonnegative) value will be returned:
57 .PP
58 SPI_OK_TD_REGISTER
59 .RS 4
60 if the captured trigger data (if any) has been successfully registered
61 .RE
62 .PP
63 On error, one of the following negative values is returned:
64 .PP
65 SPI_ERROR_ARGUMENT
66 .RS 4
67 if
68 \fItdata\fR
69 is
70 NULL
71 .RE
72 .PP
73 SPI_ERROR_UNCONNECTED
74 .RS 4
75 if called from an unconnected C function
76 .RE
77 .PP
78 SPI_ERROR_REL_DUPLICATE
79 .RS 4
80 if the name of any trigger data transient relation is already registered for this connection
81 .RE