SPI_SCROLL_CURSOR_MOVE(3pg16)
π SPI_SCROLL_CURSOR_MOVE π
okay so bestie, this one's a page from the PostgreSQL 16.15 docs β section 3, the 3pg16 manual, the whole library-call situation. it literally moves a cursor. that's it, that's the vibe. and honestly? iconic.
β¨ NAME β¨
SPI_scroll_cursor_move β move a cursor π
β¨ SYNOPSIS β¨
void SPI_scroll_cursor_move(Portal portal, FetchDirection direction,
long count)
π¦ DESCRIPTION π¦
SPI_scroll_cursor_move skips over some number of rows in a cursor. lowkey that's the whole thing. and before you ask β yes, it's exactly equivalent to the SQL command MOVE. same energy, no cap. π₯
πΈ ARGUMENTS πΈ
Portal portalβ the portal that's holding the cursor. that's your lil container bestie π«ΆFetchDirection directionβ one ofFETCH_FORWARD,FETCH_BACKWARD,FETCH_ABSOLUTEorFETCH_RELATIVE. pick your fighter πlong countβ the number-of-rows situation, and it means different things depending on your direction (iykyk):- number of rows to move for
FETCH_FORWARDorFETCH_BACKWARD - absolute row number to move to for
FETCH_ABSOLUTE - or relative row number to move to for
FETCH_RELATIVE
- number of rows to move for
β RETURN VALUE β
if it works, SPI_processed is set as in SPI_execute. that's the success vibe β¨
and SPI_tuptable is set to NULL β because this function returns no rows, like, at all. zero rows. nothing. it's giving "i'm just here to move, not to serve" π
π NOTES π
- for the details on how the
directionandcountparameters get interpreted, go look at the SQLFETCH(7)command. it's all there, fr fr π§ - > heads up bestie: direction values other than
FETCH_FORWARDmay fail if the cursor's plan was not created with theCURSOR_OPT_SCROLLoption. so yeah β not always slay, sometimes it just doesn't work π keep that in mind.
and that's the whole page! brought to you by PostgreSQL 16.15, dated 2026 β mwah, ily, go move some cursors responsibly ππ
π¦ where this page comes from
- opensuse-leap 16.0: postgresql16-docs 16.15-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