SPI_REGISTER_RELATION(3pg13)

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

🌸 NAME 🌸

okay so bestie, this is the SPI_REGISTER_RELATION(3) page from the PostgreSQL 13 docs, and it's here to explain how SPI_register_relation literally makes an ephemeral named relation available by name in SPI queries. no cap, that's the whole vibe. πŸ’…


✨ SYNOPSIS ✨

the signature is giving:

int SPI_register_relation(EphemeralNamedRelation enr)

πŸ¦‹ DESCRIPTION πŸ¦‹

SPI_register_relation makes an ephemeral named relation β€” with associated information β€” available to queries planned and executed through the current SPI connection. it's giving matchmaker for your SPI queries, and honestly? iconic. πŸ’–


πŸŽ€ ARGUMENTS πŸŽ€

  • EphemeralNamedRelation enr β€” the ephemeral named relation registry entry. that's the whole argument, bestie. 🫢

πŸ”₯ RETURN VALUE πŸ”₯

if the execution of the command was successful, you get this nonnegative value back:

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

on error, one of these 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. πŸ’€

that's the whole page, bestie 🫢 β€” sourced from PostgreSQL 13.23 docs, dated 2025, and it's SPI_REGISTER_RELATION(3), periodt. πŸ’–

πŸ“¦ where this page comes from