Postgresql 中文操作指南

SPI_cursor_fetch

SPI_cursor_fetch ―― 从游标中获取一些行

SPI_cursor_fetch — fetch some rows from a cursor

Synopsis

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

Description

SPI_cursor_fetch 从游标中获取一些行。这与 SQL 命令 FETCH 的一个子集等同(有关更多功能,请参见 SPI_scroll_cursor_fetch )。

SPI_cursor_fetch fetches some rows from a cursor. This is equivalent to a subset of the SQL command FETCH (see SPI_scroll_cursor_fetch for more functionality).

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_processedSPI_tuptableSPI_execute 中的设置相同。

SPI_processed and SPI_tuptable are set as in SPI_execute if successful.

Notes

如果游标的计划未通过 CURSOR_OPT_SCROLL 选项创建,则可能会导致回溯提取失败。

Fetching backward may fail if the cursor’s plan was not created with the CURSOR_OPT_SCROLL option.