SPI_SCRO...SOR_FETCH(3)

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

🌸 NAME 🌸

okay bestie, this is the SPI_SCRO...SOR_FETCH(3) page from the PostgreSQL 15.19 docs. the function is SPI_scroll_cursor_fetch β€” it fetches some rows from a cursor. that's it, that's the job πŸ’….

✨ SYNOPSIS ✨

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

πŸ’… DESCRIPTION πŸ’…

SPI_scroll_cursor_fetch fetches some rows from a cursor. it's literally equivalent to the SQL command FETCH β€” same energy, different API. no cap 🫢.

πŸŽ€ ARGUMENTS πŸŽ€

  • Portal portal β€” the portal containing the cursor. that's your cursor's home base 🏠
  • FetchDirection direction β€” one of FETCH_FORWARD, FETCH_BACKWARD, FETCH_ABSOLUTE or FETCH_RELATIVE. pick your fighter ✨
  • long count β€” number of rows to fetch for FETCH_FORWARD or FETCH_BACKWARD; absolute row number to fetch for FETCH_ABSOLUTE; or relative row number to fetch for FETCH_RELATIVE. yes, the meaning shifts depending on direction, so read the room bestie πŸ‘€

πŸ”₯ RETURN VALUE πŸ”₯

if it succeeds, SPI_processed and SPI_tuptable are set as in SPI_execute. that's the whole return-value tea β˜•βœ¨

πŸ¦‹ NOTES πŸ¦‹

for the full deets on how the direction and count parameters are interpreted, see the SQL FETCH(7) command. iykyk πŸ“–

⚠️ 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. that's a real caveat, not a vibe β€” don't sleep on it πŸ’€

mwah πŸ’‹ that's the whole page β€” source/version: PostgreSQL 15.19, date: 2026, manual name: SPI_SCRO...SOR_FETCH(3). byeee πŸ«ΆπŸ‘‘

πŸ“¦ where this page comes from