SPI_EXECP(3)
π 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 fromSPI_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 thatnullsis 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, or0for 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
- opensuse-leap 16.0: postgresql17-docs 17.11-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms