SPI_CURSOR_FETCH(3)
β¨ NAME β¨
Okay bestie, this is the SPI_CURSOR_FETCH(3) manual page from the PostgreSQL 13.23 docs, and it's all about SPI_cursor_fetch β the function that fetches some rows from a cursor. Cursor-fetch core, no cap. π
π¦ SYNOPSIS π¦
void SPI_cursor_fetch(Portal portal, bool forward, long count)
π DESCRIPTION π
So SPI_cursor_fetch fetches some rows from a cursor. It's equivalent to a subset of the SQL command FETCH β and for more functionality, see SPI_scroll_cursor_fetch. That's the vibe: this one is the focused subset, and the other one has extra moves. β¨
πΈ ARGUMENTS πΈ
These are the three things you pass in, bestie:
Portal portalβ the portal containing the cursor. That's your cursor-holding bestie. π«Άbool forwardβtruefor fetch forward,falsefor fetch backward. Binary queen behavior. πlong countβ the maximum number of rows to fetch. Maximum, not a promise, okay? π
π RETURN VALUE π
If it's successful, SPI_processed and SPI_tuptable are set as in SPI_execute. That's the whole return-value situation. β
β οΈ NOTES β οΈ
Bestie, heads up: fetching backward may fail if the cursor's plan was not created with the CURSOR_OPT_SCROLL option. That's a real caveat, not a drill. π
π That's the page, bestie! Source/version: PostgreSQL 13.23; date: 2025. SPI_CURSOR_FETCH(3) said what it said, and it ate. Periodt. πβ¨
π¦ 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