SPI_EXECP(3)

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

πŸ’… SPI_EXECP(3) β€” the "just run it, bestie" page

okay so real talk, this is SPI_EXECP from the PostgreSQL 17.11 Documentation set of manual pages, section 3, and it's honestly such a mood. Let's get into it ✨


🌸 NAME 🌸

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

πŸ¦‹ SYNOPSIS πŸ¦‹

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

πŸ’– DESCRIPTION πŸ’–

So SPI_execp is literally just SPI_execute_plan, except the latter's read_only parameter is always taken as false. That's it. That's the whole difference. It's giving "same girl, different wig" πŸ’… no cap.

✨ ARGUMENTS ✨

  • SPIPlanPtr plan β€” the prepared statement, which you got back from SPI_prepare. Your main character, basically πŸ‘‘
  • Datum * values β€” an array of the actual parameter values. It must have the same length as the statement's number of arguments, fr fr. Don't try to be cute and pass a shorter one πŸ™ˆ
  • const char * nulls β€” an array describing which parameters are null. Must have the same length as the statement's number of arguments too 🫢

So here's the tea: 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. (In that null case, the actual value in the corresponding values entry doesn't matter β€” it's just vibes at that point πŸ’€)

⚠️ And note that nulls is not a text string, just an array: it does not need a '\0' terminator. Do not come for me with your C-string assumptions, bestie 😭
  • long count β€” maximum number of rows to return, or 0 for no limit. 0 = unlimited = chaotic good 🌈

πŸ”₯ RETURN VALUE πŸ”₯

See SPI_execute_plan. Like, go read that one, iykyk πŸ“–

SPI_processed and SPI_tuptable are set as in SPI_execute if successful. Slay πŸ’œ


and that's the whole page, babes β€” written up in the PostgreSQL 17.11 docs, dated 2026, and filed under SPI_EXECP(3) πŸŽ€ go forth and execute responsibly ✨

πŸ“¦ where this page comes from