SPI_EXEC(3)
π SPI_EXEC(3) π
okay bestie, welcome to the PostgreSQL 18.6 docs, section 3 of the manual, and today's main character is SPI_exec π no cap, she's a tiny little function with a whole lot of power.
β¨ NAME β¨
SPI_exec β execute a read/write command π₯
like literally. she runs your command and she is not here for the read-only lifestyle.
β¨ SYNOPSIS β¨
int SPI_exec(const char * command, long count)
two args, one int coming back at you. that's the whole vibe π¦
β¨ DESCRIPTION β¨
so here's the tea β SPI_exec is literally the same as SPI_execute, except that SPI_execute's read_only parameter is always taken as false. always always. no negotiating, no "but what if", it's just false periodt π
which lowkey means: this one is the read/write girlie. she will absolutely let you change things. she said "not me being the dangerous twin" and honestly? iconic.
β¨ ARGUMENTS β¨
const char * commandβ the string containing the command to execute π like, the actual thing you want her to run, as a string, that's it.long countβ the maximum number of rows to return, or0for no limit π so if you want everything, you say0, and she's like "say less".
β¨ RETURN VALUE β¨
see SPI_execute π she doesn't do her own return value lore, she just points you at her sister's page. iykyk.
π«Ά quick reminder bestie:read_onlyis hardwired tofalsehere, so do NOT come crying to me if you wanted a cute little read-only moment. that's not this function. that'sSPI_execute. π
and that's the whole page, you ate it π
PostgreSQL 18.6 documentation, dated 2026 β that's the source, the version and the date, mwah, bye bestie, go run some commands responsibly π§β¨π
π¦ where this page comes from
- opensuse-leap 16.0: postgresql18-docs 18.6-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms