SPI_EXECUTE_PLAN(3)
π SPI_EXECUTE_PLAN(3)
okay so bestie, this is the PostgreSQL 15.19 Documentation page for SPI_execute_plan, and itβs giving prepared-statement execution realness β¨ no cap, this one is literally about running a statement that SPI_prepare already set up. π«Ά
πΈ NAME πΈ
SPI_execute_plan β execute a statement prepared by SPI_prepare π
π¦ SYNOPSIS π¦
int SPI_execute_plan(SPIPlanPtr plan, Datum * values, const char * nulls,
bool read_only, long count)
π DESCRIPTION π
SPI_execute_plan executes a statement prepared by SPI_prepare or one of its siblings. iconic behavior tbh π
read_only and count have the same interpretation as in SPI_execute. periodt β¨
π ARGUMENTS π
SPIPlanPtr planβ prepared statement (returned bySPI_prepare) π§Datum * valuesβ an array of actual parameter values. Must have same length as the statementβs number of arguments. bestie, do not skip the matching-length vibe check πconst char * nullsβ an array describing which parameters are null. Must have same length as the statementβs number of arguments. π¦
If nulls is NULL then SPI_execute_plan 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 the latter case, the actual value in the corresponding values entry doesnβt matter.) Note that nulls is not a text string, just an array: it does not need a '\0' terminator. iykyk, itβs an array not a whole string situation π
bool read_onlyβtruefor read-only execution πΈlong countβ maximum number of rows to return, or0for no limit π₯
π₯ RETURN VALUE π₯
The return value is the same as for SPI_execute, with the following additional possible error (negative) results: π
SPI_ERROR_ARGUMENTβ ifplanisNULLor invalid, orcountis less than0πSPI_ERROR_PARAMβ ifvaluesisNULLandplanwas prepared with some parameters π
SPI_processed and SPI_tuptable are set as in SPI_execute if successful. slay β¨
xoxo, your PostgreSQL 15.19 docs bestie π β page dated 2026, mwah π
π¦ where this page comes from
- opensuse-leap 16.0: postgresql15-docs 15.19-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