SPI_CURSOR_FETCH(3)
π SPI_CURSOR_FETCH(3) π
okay bestie, welcome to the PostgreSQL 18.6 docs, cursor edition π this one's a little C function from the SPI family and it's genuinely so useful, no cap.
β¨ NAME β¨
SPI_cursor_fetch β grab some rows from a cursor, that's the whole vibe π¦
πΈ SYNOPSIS πΈ
void SPI_cursor_fetch(Portal portal, bool forward, long count)
π DESCRIPTION π
So SPI_cursor_fetch fetches some rows from a cursor. That's it, that's the function π
It's equivalent to a subset of the SQL command FETCH β like, the mini version. If you want more functionality, go check out SPI_scroll_cursor_fetch, she does the extra stuff π
π«Ά ARGUMENTS π«Ά
Portal portalβ the portal that's holding your cursor. that's her house πbool forwardβtruemeans fetch forward,falsemeans fetch backward. literally just which way you're walking the list πΆββοΈlong countβ the maximum number of rows to fetch. the cap, the limit, the ceiling β
π RETURN VALUE π
If it works, SPI_processed and SPI_tuptable get set exactly the same way as they do in SPI_execute. same energy, same rules β¨
π NOTES π
Fetching backward may fail if the cursor's plan was not created with the CURSOR_OPT_SCROLL option. so likeβ¦ if you didn't build her with scroll energy, don't be shocked when she can't rewind π
and that's the whole page, bestie!! go forth and fetch responsibly π§ββοΈ
this has been the PostgreSQL 18.6 documentation, dated 2026 β mwah, ilysm, see you in the next manpage πππ¦
π¦ 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