SPI_SCRO...SOR_FETCH(3)

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

✨ SPI_scroll_cursor_fetch β€” fetch some rows from a cursor, bestie ✨

It's giving "PostgreSQL 14.24 Documentation" energy, and the manual page we're vibing with today is SPI_SCRO...SOR_FETCH(3). Yes the title is truncated, no I will not be fixing it, that's just how the manpage woke up today πŸ’…


🌸 NAME 🌸

SPI_scroll_cursor_fetch β€” fetch some rows from a cursor. That's it, that's the whole vibe. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

void SPI_scroll_cursor_fetch(Portal portal, FetchDirection direction,
                             long count)

Copy it exactly, bestie, don't be creative with the signature, this is not the place for main character energy 😭


πŸ’– DESCRIPTION πŸ’–

okay so SPI_scroll_cursor_fetch fetches some rows from a cursor. Lowkey iconic. And highkey it's literally equivalent to the SQL command FETCH. No cap, that's the whole thing β€” same energy, different entrance. ✨


🌈 ARGUMENTS 🌈

  • Portal portal β€” the portal containing the cursor 🫢 like, the whole cursor lives in here, that's the container, that's the home.
  • FetchDirection direction β€” one of FETCH_FORWARD, FETCH_BACKWARD, FETCH_ABSOLUTE or FETCH_RELATIVE. Four choices, pick your fighter πŸ’€
  • long count β€” the number, and what it means depends on the direction, so pay attention bestie:
    • for FETCH_FORWARD or FETCH_BACKWARD it's the number of rows to fetch
    • for FETCH_ABSOLUTE it's the absolute row number to fetch
    • for FETCH_RELATIVE it's the relative row number to fetch

Same variable, three different personalities. It's giving versatile πŸ‘‘


🧚 RETURN VALUE 🧚

SPI_processed and SPI_tuptable are set as in SPI_execute if successful. So if it slays, you get the same side effects as SPI_execute, periodt. πŸ’œ


⭐ NOTES ⭐

See the SQL FETCH(7) command for details of the interpretation of the direction and count parameters. The lore is documented elsewhere, iykyk πŸ“–

⚠️ okay important one: direction values other than FETCH_FORWARD may fail if the cursor's plan was not created with the CURSOR_OPT_SCROLL option. So like… if you didn't opt into scrolling at plan time, don't come crying to me when FETCH_BACKWARD ghosts you 😭 not a bug, just the rules fr fr

and that's the whole page, bestie, every flag, every argument, every caveat, nothing skipped πŸ’…

caught you at the very end for the cute sign-off: this little gem comes from the PostgreSQL 14.24 documentation, dated 2026, and the page itself is SPI_SCRO...SOR_FETCH(3) β€” truncated title and all, we love her anyway πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from