SPI_SCRO...SOR_FETCH(3)
πΈ NAME πΈ
okay bestie, this is the SPI_SCRO...SOR_FETCH(3) page from the PostgreSQL 15.19 docs. the function is SPI_scroll_cursor_fetch β it fetches some rows from a cursor. that's it, that's the job π
.
β¨ SYNOPSIS β¨
void SPI_scroll_cursor_fetch(Portal portal, FetchDirection direction,
long count)
π DESCRIPTION π
SPI_scroll_cursor_fetch fetches some rows from a cursor. it's literally equivalent to the SQL command FETCH β same energy, different API. no cap π«Ά.
π ARGUMENTS π
Portal portalβ the portal containing the cursor. that's your cursor's home base πFetchDirection directionβ one ofFETCH_FORWARD,FETCH_BACKWARD,FETCH_ABSOLUTEorFETCH_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. yes, the meaning shifts depending ondirection, so read the room bestie π
π₯ RETURN VALUE π₯
if it succeeds, SPI_processed and SPI_tuptable are set as in SPI_execute. that's the whole return-value tea ββ¨
π¦ NOTES π¦
for the full deets on how the direction and count parameters are interpreted, see the SQL FETCH(7) command. iykyk π
β οΈ heads up bestie: direction values other thanFETCH_FORWARDmay fail if the cursor's plan was not created with theCURSOR_OPT_SCROLLoption. that's a real caveat, not a vibe β don't sleep on it π
mwah π that's the whole page β source/version: PostgreSQL 15.19, date: 2026, manual name: SPI_SCRO...SOR_FETCH(3). byeee π«Άπ
π¦ where this page comes from
- opensuse-leap 16.0: postgresql15-docs 15.19-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