SPI_CURSOR_CLOSE(3)
β¨ SPI_CURSOR_CLOSE β¨
okay bestie, welcome to the SPI_CURSOR_CLOSE page, straight out of the PostgreSQL 18.6 docs π this is the little function that says "bye bye" to a cursor and gives its storage back. short page, but it matters, so let's go π«Ά
πΈ NAME πΈ
SPI_cursor_close β bestie... she closes a cursor. that's the whole vibe. π
π¦ SYNOPSIS π¦
void SPI_cursor_close(Portal portal)
like... no return value, she just does it. main character energy fr fr β¨
π DESCRIPTION π
so here's the tea β: SPI_cursor_close closes a cursor that you already made earlier, and it releases that cursor's portal storage. gone. freed. slay.
and here's the part that lowkey changes your whole life: all open cursors get closed automatically at the end of a transaction. periodt. so the transaction is basically the responsible adult here π
which means you only need to call SPI_cursor_close if you want to release those resources sooner β like, before the transaction wraps up. it's not required, it's just... proactive. it's giving "I clean up after myself before the party's over" π
π ARGUMENTS π
Portal portalβ the portal that's holding the cursor. that's it, that's the whole argument. one portal, one job π―
β οΈ no cap, the only real thing to remember here: if you don't call this, the end of the transaction will do it for you anyway. so don't stress, but also don't hoard resources like a lil dragon πβ¨
and that's the page, bestie!! this gorgeousness came to you from PostgreSQL 18.6, dated 2026 β mwah π go close those cursors 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