SPI_CURSOR_FETCH(3)

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

✨ NAME ✨

Okay bestie, this is the SPI_CURSOR_FETCH(3) manual page from the PostgreSQL 13.23 docs, and it's all about SPI_cursor_fetch β€” the function that fetches some rows from a cursor. Cursor-fetch core, no cap. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

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

πŸ’– DESCRIPTION πŸ’–

So SPI_cursor_fetch fetches some rows from a cursor. It's equivalent to a subset of the SQL command FETCH β€” and for more functionality, see SPI_scroll_cursor_fetch. That's the vibe: this one is the focused subset, and the other one has extra moves. ✨

🌸 ARGUMENTS 🌸

These are the three things you pass in, bestie:

  • Portal portal β€” the portal containing the cursor. That's your cursor-holding bestie. 🫢
  • bool forward β€” true for fetch forward, false for fetch backward. Binary queen behavior. πŸ’…
  • long count β€” the maximum number of rows to fetch. Maximum, not a promise, okay? 😌

πŸ‘‘ RETURN VALUE πŸ‘‘

If it's successful, SPI_processed and SPI_tuptable are set as in SPI_execute. That's the whole return-value situation. β˜•

⚠️ NOTES ⚠️

Bestie, heads up: fetching backward may fail if the cursor's plan was not created with the CURSOR_OPT_SCROLL option. That's a real caveat, not a drill. 😭

πŸ’– That's the page, bestie! Source/version: PostgreSQL 13.23; date: 2025. SPI_CURSOR_FETCH(3) said what it said, and it ate. Periodt. πŸŽ€βœ¨

πŸ“¦ where this page comes from