SPI_SCRO...SOR_FETCH(3)
hii bestie π you're on the SPI_SCRO...SOR_FETCH(3) page from the PostgreSQL 17.11 manual β it's all about SPI_scroll_cursor_fetch, and yes, we're gonna make it make sense.
NAME β¨
SPI_scroll_cursor_fetch β fetch some rows from a cursor, bestie. That's the whole vibe.
SYNOPSIS π
void SPI_scroll_cursor_fetch(Portal portal, FetchDirection direction,
long count)
DESCRIPTION π
Okay so SPI_scroll_cursor_fetch fetches some rows from a cursor. It is literally equivalent to the SQL command FETCH. No cap.
ARGUMENTS π¦
Portal portalβ the portal containing the cursor. That's the main character right there.FetchDirection directionβ one ofFETCH_FORWARD,FETCH_BACKWARD,FETCH_ABSOLUTE, orFETCH_RELATIVE. Pick your fighter πlong countβ number of rows to fetch forFETCH_FORWARDorFETCH_BACKWARD; absolute row number to fetch forFETCH_ABSOLUTE; or relative row number to fetch forFETCH_RELATIVE. The way this one little argument changes meaning depending ondirection? iconic, honestly.
RETURN VALUE π
SPI_processed and SPI_tuptable are set as in SPI_execute if successful. So if it slays, those get set β periodt.
NOTES πΈ
See the SQL FETCH(7) command for details of the interpretation of the direction and count parameters. iykyk.
Direction values other thanFETCH_FORWARDmay fail if the cursor's plan was not created with theCURSOR_OPT_SCROLLoption. Lowkey important β do not sleep on that, bestie π
xoxo, PostgreSQL 17.11 β 2026, from your SPI_SCRO...SOR_FETCH(3) bestie π§ββοΈπ
π¦ where this page comes from
- opensuse-leap 16.0: postgresql17-docs 17.11-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