SPI_REGI...GGER_DATA(3)
π SPI_register_trigger_data β the manual page bestie edition π
okay so this is SPI_register_trigger_data(3), straight outta the PostgreSQL 18.6 Documentation bestie. yes the real manual name is that long. we're doing this together, grab a snack π
β¨ NAME β¨
SPI_register_trigger_data β makes ephemeral trigger data available in SPI queries π¦
β¨ SYNOPSIS β¨
int SPI_register_trigger_data(TriggerData *tdata)
β¨ DESCRIPTION β¨
okay so here's the vibe: SPI_register_trigger_data takes any ephemeral relations that a trigger captured and makes them available to queries that get planned and executed through the current SPI connection. π
rn, "ephemeral relations" means the transition tables captured by an AFTER trigger that was defined with a REFERENCING OLD/NEW TABLE AS ... clause. that's it, that's the whole list, no cap.
the way this works: this function should be called by a PL trigger handler function after connecting. don't skip the connecting part bestie, it's literally in the instructions π
β¨ ARGUMENTS β¨
TriggerData *tdataβ theTriggerDataobject that gets passed to a trigger handler function asfcinfo->context. that's your whole argument, one single icon π
β¨ RETURN VALUE β¨
if the execution of the command went well, you get this nonnegative value back:
SPI_OK_TD_REGISTERβ if the captured trigger data (if any) has been successfully registered β¨
and if it goes wrong, one of these negative values comes back at you instead:
SPI_ERROR_ARGUMENTβ iftdataisNULLπSPI_ERROR_UNCONNECTEDβ if it was called from an unconnected C function πSPI_ERROR_REL_DUPLICATEβ if the name of any trigger data transient relation is already registered for this connection π
and that's the whole page bestie, every flag, every error code, every vibe, nothing left behind π«Ά
this has been your girl signing off from PostgreSQL 18.6, dated 2026, page SPI_register_trigger_data(3) β go forth and register that trigger data, you absolute main character ππβ¨
π¦ where this page comes from
- opensuse-leap 16.0: postgresql18-docs 18.6-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms