SPI_REGISTER_RELATION(3pg17)

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

✨ NAME ✨

Okay bestie, welcome to SPI_REGISTER_RELATION(3) from the PostgreSQL 17.11 Documentation πŸ’– β€” this page is literally about SPI_register_relation: make an ephemeral named relation available by name in SPI queries. Slay.

🌸 SYNOPSIS 🌸

int SPI_register_relation(EphemeralNamedRelation enr)

πŸ¦‹ DESCRIPTION πŸ¦‹

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 β€œregistry entry, but make it query-visible” ✨.

πŸŽ€ 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, then this nonnegative value gets returned:

  • SPI_OK_REL_REGISTER β€” if the relation has been successfully registered by name πŸ‘‘.

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 πŸ™ˆ.
Negative return values mean error vibes, periodt. Nonnegative means success β€” no cap.

mwah πŸ’‹ β€” from the PostgreSQL 17.11 docs, dated 2026, page SPI_REGISTER_RELATION(3). Bye bestie! πŸŽ€πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from