SPI_SCROLL_CURSOR_MOVE(3pg16)

πŸ“¦ version 16.15, in opensuse-leap 16.0

πŸ’… 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 of FETCH_FORWARD, FETCH_BACKWARD, FETCH_ABSOLUTE or FETCH_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_FORWARD or FETCH_BACKWARD
    • absolute row number to move to for FETCH_ABSOLUTE
    • or relative row number to move to for FETCH_RELATIVE

⭐ 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 direction and count parameters get interpreted, go look at the SQL FETCH(7) command. it's all there, fr fr 🧚
  • > heads up bestie: direction values other than FETCH_FORWARD may fail if the cursor's plan was not created with the CURSOR_OPT_SCROLL option. 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