SPI_CURSOR_FETCH(3)

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

πŸ’– NAME πŸ’–

SPI_cursor_fetch β€” fetch some rows from a cursor. This is the SPI_CURSOR_FETCH(3) manual page, bestie, and it’s short but iconic ✨


πŸŽ€ SYNOPSIS πŸŽ€

void SPI_cursor_fetch(Portal portal, bool forward, long count)

🌸 DESCRIPTION 🌸

Okay so SPI_cursor_fetch fetches some rows from a cursor. It’s literally equivalent to a subset of the SQL command FETCH β€” and if you want more functionality, go see SPI_scroll_cursor_fetch, iykyk πŸ¦‹


✨ ARGUMENTS ✨

  • Portal portal β€” portal containing the cursor πŸ‘‘
  • bool forward β€” true for fetch forward, false for fetch backward πŸŽ€
  • long count β€” maximum number of rows to fetch πŸ’…

πŸ”₯ RETURN VALUE πŸ”₯

SPI_processed and SPI_tuptable are set as in SPI_execute if successful. That’s the whole vibe πŸ’–


πŸ’€ NOTES πŸ’€

Fetching backward may fail if the cursor’s plan was not created with the CURSOR_OPT_SCROLL option. Not me warning you dramatically, but fr fr watch out for that πŸ™ˆ


xoxo, PostgreSQL 14.24 Documentation, dated 2026 β€” mwah πŸŽ€πŸ’‹

πŸ“¦ where this page comes from