SPI_EXECUTE_PLAN(3)
π NAME π
okay bestie, this is the SPI_EXECUTE_PLAN(3) page β and it's all about SPI_execute_plan, which executes a statement prepared by SPI_prepare. slay. β¨
β¨ 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. no cap, that's the whole vibe. π
read_only and count have the same interpretation as in SPI_execute.
π ARGUMENTS π
SPIPlanPtr planβ the prepared statement (returned bySPI_prepare) π«ΆDatum * valuesβ an array of actual parameter values. It must have the same length as the statement's number of arguments. literally must match, bestie.const char * nullsβ an array describing which parameters are null. It must have the 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. cute but important. π
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 than0SPI_ERROR_PARAMβ ifvaluesisNULLandplanwas prepared with some parameters
SPI_processed and SPI_tuptable are set as in SPI_execute if successful.
kisses from the PostgreSQL 13.23 docs, dated 2025 β mwah ππ
π¦ where this page comes from
- opensuse-leap 16.0: postgresql13-docs 13.23-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