SPI_REGI...GGER_DATA(3)
π NAME π
okay so you're on the <SPI_REGI...GGER_DATA(3)> page, bestie, and the function is SPI_register_trigger_data π
β it makes ephemeral trigger data available in SPI queries. That's the whole assignment: trigger data, but make it available to SPI queries. periodt.
π SYNOPSIS π
int SPI_register_trigger_data(TriggerData *tdata)
β¨ DESCRIPTION β¨
This function SPI_register_trigger_data makes any ephemeral relations captured by a trigger available to queries planned and executed through the current SPI connection. No cap, that's the glow-up.
Currently, this means the transition tables captured by an AFTER trigger defined with a REFERENCING OLD/NEW TABLE AS ... clause. It's giving AFTER-trigger transition-table realness.
This function should be called by a PL trigger handler function after connecting. Call it after connecting, bestie β that's the assignment.
πΈ ARGUMENTS πΈ
TriggerData *tdataβ theTriggerDataobject passed to a trigger handler function asfcinfo->context. That's the trigger context package you get handed.
π₯ RETURN VALUE π₯
If the execution of the command was successful, then the following (nonnegative) value will be returned:
SPI_OK_TD_REGISTERβ if the captured trigger data (if any) has been successfully registered. Success slay β¨
On error, one of the following negative values is returned:
SPI_ERROR_ARGUMENTβ iftdataisNULL. ya forgot the data, bestie πSPI_ERROR_UNCONNECTEDβ if called from an unconnected C function. no connection, no party πSPI_ERROR_REL_DUPLICATEβ if the name of any trigger data transient relation is already registered for this connection. duplicate name energy, not iconic π
PostgreSQL 15.19 documentation, dated 2026, for the SPI_REGI...GGER_DATA(3) page β that's the footer tea, bestie. xoxo, have fun registering that trigger data πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: postgresql15-docs 15.19-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms