SPI_SCRO...SOR_FETCH(3)
β¨ SPI_scroll_cursor_fetch β fetch some rows from a cursor, bestie β¨
It's giving "PostgreSQL 14.24 Documentation" energy, and the manual page we're vibing with today is SPI_SCRO...SOR_FETCH(3). Yes the title is truncated, no I will not be fixing it, that's just how the manpage woke up today π
πΈ NAME πΈ
SPI_scroll_cursor_fetch β fetch some rows from a cursor. That's it, that's the whole vibe. π
π¦ SYNOPSIS π¦
void SPI_scroll_cursor_fetch(Portal portal, FetchDirection direction,
long count)
Copy it exactly, bestie, don't be creative with the signature, this is not the place for main character energy π
π DESCRIPTION π
okay so SPI_scroll_cursor_fetch fetches some rows from a cursor. Lowkey iconic. And highkey it's literally equivalent to the SQL command FETCH. No cap, that's the whole thing β same energy, different entrance. β¨
π ARGUMENTS π
Portal portalβ the portal containing the cursor π«Ά like, the whole cursor lives in here, that's the container, that's the home.FetchDirection directionβ one ofFETCH_FORWARD,FETCH_BACKWARD,FETCH_ABSOLUTEorFETCH_RELATIVE. Four choices, pick your fighter πlong countβ the number, and what it means depends on the direction, so pay attention bestie:- for
FETCH_FORWARDorFETCH_BACKWARDit's the number of rows to fetch - for
FETCH_ABSOLUTEit's the absolute row number to fetch - for
FETCH_RELATIVEit's the relative row number to fetch
- for
Same variable, three different personalities. It's giving versatile π
π§ RETURN VALUE π§
SPI_processed and SPI_tuptable are set as in SPI_execute if successful. So if it slays, you get the same side effects as SPI_execute, periodt. π
β NOTES β
See the SQL FETCH(7) command for details of the interpretation of the direction and count parameters. The lore is documented elsewhere, iykyk π
β οΈ okay important one: direction values other thanFETCH_FORWARDmay fail if the cursor's plan was not created with theCURSOR_OPT_SCROLLoption. So likeβ¦ if you didn't opt into scrolling at plan time, don't come crying to me whenFETCH_BACKWARDghosts you π not a bug, just the rules fr fr
and that's the whole page, bestie, every flag, every argument, every caveat, nothing skipped π
caught you at the very end for the cute sign-off: this little gem comes from the PostgreSQL 14.24 documentation, dated 2026, and the page itself is SPI_SCRO...SOR_FETCH(3) β truncated title and all, we love her anyway ππ¦π
π¦ where this page comes from
- opensuse-leap 16.0: postgresql14-docs 14.24-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