SPI_SCROL...RSOR_MOVE(3)

πŸ’« SPI_SCROL...RSOR_MOVE πŸ’«

okay bestie, welcome to the PostgreSQL 18.6 docs, page SPI_SCROL...RSOR_MOVE(3). yes the name is truncated, no we're not gonna talk about it, it's giving ✨mysterious✨. anyway this is the page about SPI_scroll_cursor_move and it's lowkey so useful.


🌸 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. literally that's it, that's the whole job. it's equivalent to the SQL command MOVE. no cap 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • Portal portal β€” the portal that's holding the cursor πŸ’…
  • FetchDirection direction β€” one of FETCH_FORWARD, FETCH_BACKWARD, FETCH_ABSOLUTE or FETCH_RELATIVE. pick your vibe πŸ”₯
  • long count β€” here's the tea, the meaning shifts depending on your direction:
    • for FETCH_FORWARD or FETCH_BACKWARD: the number of rows to move
    • for FETCH_ABSOLUTE: the absolute row number to move to
    • for FETCH_RELATIVE: the relative row number to move to

πŸ‘‘ RETURN VALUE πŸ‘‘

if it works, SPI_processed is set as in SPI_execute. and SPI_tuptable is set to NULL, since no rows are returned by this function. it moved, it didn't bring anything back. it's a mover not a giver, iykyk πŸ’€


🧚 NOTES 🧚

  • go read the SQL FETCH(7) command if you want the full details on how direction and count are interpreted. fr fr, it's all in there πŸ“–
  • ⚠️ direction values other than FETCH_FORWARD may fail if the cursor's plan was not created with the CURSOR_OPT_SCROLL option. so like... check that first, bestie, don't get caught out 😭

PostgreSQL 18.6 Β· 2026 Β· SPI_SCROL...RSOR_MOVE(3)

and that's the whole page! πŸ’œ mwah, go move some cursors, you absolute icon, and remember: scroll responsibly βœ¨πŸŽ€πŸ¦‹