SPI_REGISTER_RELATION(3pg16)

πŸ“¦ version 16.15, in opensuse-leap 16.0

🌸 NAME 🌸

okay so this is the SPI_REGISTER_RELATION(3pg16) page from the PostgreSQL 16.15 docs β€” welcome to the bestie edition πŸ’–

SPI_register_relation β€” makes an ephemeral named relation available by name in SPI queries. Periodt.

✨ SYNOPSIS ✨

int SPI_register_relation(EphemeralNamedRelation enr)

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so SPI_register_relation makes an ephemeral named relation β€” with all its associated information β€” available to queries that are planned and executed through the current SPI connection. It’s giving β€œhey bestie, meet your queries” energy, but make it C API 🌈

πŸŽ€ ARGUMENTS πŸŽ€

  • EphemeralNamedRelation enr β€” the ephemeral named relation registry entry. That’s the one, no cap πŸ’…

πŸ‘‘ RETURN VALUE πŸ‘‘

If the execution of the command was successful, then the following (nonnegative) value will be returned:

  • SPI_OK_REL_REGISTER β€” if the relation has been successfully registered by name. slay ✨

On error, one of the following negative values is returned:

  • SPI_ERROR_ARGUMENT β€” if enr is NULL or its name field is NULL.
  • SPI_ERROR_UNCONNECTED β€” if called from an unconnected C function.
  • SPI_ERROR_REL_DUPLICATE β€” if the name specified in the name field of enr is already registered for this connection.
bestie, negative return values mean something went wrong β€” check which one you got πŸ‘€

xoxo, from PostgreSQL 16.15, dated 2026 β€” bye bestie, go register those ephemeral named relations responsibly πŸ«ΆπŸ’–

πŸ“¦ where this page comes from