SPI_UNRE..._RELATION(3)

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

✨ SPI_unregister_relation(3) ✨

okay so bestie, welcome to the SPI_unregister_relation page β€” it's living inside the PostgreSQL 16.15 Documentation and honestly it's giving "small but mighty" πŸŽ€ it's a section-3 libpq/SPI-adjacent manual page and we're gonna get through it together, no cap.


🌸 NAME 🌸

SPI_unregister_relation β€” remove an ephemeral named relation from the registry πŸ’…

like, it's the breakup function. the relation is leaving the group chat. periodt.


πŸ¦‹ SYNOPSIS πŸ¦‹

int SPI_unregister_relation(const char * name)

look at her. one argument. returns an int. iconic behavior honestly ✨


πŸ’– DESCRIPTION πŸ’–

SPI_unregister_relation removes an ephemeral named relation from the registry for the current connection.

that's it. that's the whole vibe. it's the un-registering counterpart to whatever got that relation in there in the first place, and it only touches the current connection's registry β€” so don't go thinking it's cleaning up everybody's stuff, because she is not 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • const char * name β€” the relation registry entry name πŸ”₯ literally just the name of the entry you want gone. that's the whole argument. slay.

⭐ RETURN VALUE ⭐

bestie, listen, the return value has two whole moods depending on how things went πŸ‘‘

πŸ“ On success

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

  • SPI_OK_REL_UNREGISTER β€” if the tuplestore has been successfully removed from the registry πŸ’œ (yes, nonnegative β€” she's happy, she's thriving, she ate)

πŸ’€ On error

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

  • SPI_ERROR_ARGUMENT β€” if name is NULL πŸ™ˆ like babe you have to actually give her a name
  • SPI_ERROR_UNCONNECTED β€” if called from an unconnected C function 😭 no connection, no service
  • SPI_ERROR_REL_NOT_FOUND β€” if name is not found in the registry for the current connection πŸ’€ she looked everywhere and that entry is simply not there
ngl the negative-return thing is the actual important part β€” check it, don't just assume it worked, because a NULL name or a not-found entry is lowkey easy to hit and it will not warn you any louder than this πŸ‘€

k byeee, that's the whole page 🧚 go unregister something responsibly πŸ’…

sign-off szn: this was PostgreSQL 16.15, dated 2026, and the page is SPI_UNRE..._RELATION(3) β€” mwah, stan the docs, see u in SEE ALSO (jk there isn't one, this page said "that's all folks") πŸŒˆπŸ’–

πŸ“¦ where this page comes from