SPI_EXECP(3)

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

✨ SPI_EXECP(3) ✨

okay so bestie, welcome to the tea on SPI_EXECP(3) β€” it's a page from the PostgreSQL 14.24 Documentation and honestly it's giving "short but mighty" πŸ’…


🌸 NAME 🌸

SPI_execp β€” execute a statement in read/write mode πŸ”₯


πŸŽ€ SYNOPSIS πŸŽ€

int SPI_execp(SPIPlanPtr plan, Datum * values, const char * nulls, long count)

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so SPI_execp is literally the same as SPI_execute_plan, except that the read_only parameter of that other function is always taken as false. periodt. that's the whole vibe β€” you're in read/write mode, no cap πŸ’€


πŸ’– ARGUMENTS πŸ’–

  • SPIPlanPtr plan β€” the prepared statement, which you get back from SPI_prepare 🫢
  • Datum * values β€” an array of the actual parameter values you're passing in. it has to have the same length as the statement's number of arguments, fr fr.
  • const char * nulls β€” an array that describes which parameters are null. also has to have the same length as the statement's number of arguments ✨

if nulls is NULL, then SPI_execp assumes that no parameters are null. otherwise, each entry of the nulls array should be ' ' if the corresponding parameter value is non-null, or 'n' if the corresponding parameter value is null. (and in that null case? the actual value in the corresponding values entry doesn't matter, so don't stress πŸ™ˆ)

heads up bestie: nulls is not a text string, it's just an array β€” so it does not need a '\0' terminator. it's giving "array not string" energy, iykyk ⭐
  • long count β€” maximum number of rows to return, or 0 for no limit πŸ‘‘

🌈 RETURN VALUE 🌈

see SPI_execute_plan β€” that's where the return value tea lives πŸ’œ

SPI_processed and SPI_tuptable are set as in SPI_execute if successful ✨


and that's the whole page, bestie β€” short, sweet, and iconic πŸŽ€ sign-off time: this one's from PostgreSQL 14.24, dated 2026 β€” slay πŸ’…

πŸ“¦ where this page comes from