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
- alpine 3.23: postgresql18-doc 18.6-r0 Β· PostgreSQL
- alpine 3.24: postgresql18-doc 18.6-r0 Β· PostgreSQL
- arch rolling: postgresql 18.6-4 Β· PostgreSQL
- fedora 43: postgresql-server-devel 18.6-1.fc43 Β· PostgreSQL
- fedora 43: postgresql-server-devel 18.6-1.fc43 Β· PostgreSQL
- fedora 44: postgresql-server-devel 18.6-1.fc44 Β· PostgreSQL
- fedora 44: postgresql-server-devel 18.6-1.fc44 Β· PostgreSQL
- nixos 26.05: postgresql 18.6
- ubuntu resolute: postgresql-doc-18 18.6-0ubuntu0.26.04.1 Β· PostgreSQL
- ubuntu stonking: postgresql-doc-18 18.6-3build2 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms