SPI_IS_CURSOR_PLAN(3)
π
NAME β SPI_IS_CURSOR_PLAN(3)
SPI_is_cursor_plan β returns true if a statement prepared by SPI_prepare can be used with SPI_cursor_open. β¨
β¨ SYNOPSIS
bool SPI_is_cursor_plan(SPIPlanPtr plan)
π¦ DESCRIPTION
okay so bestie, SPI_is_cursor_plan returns true if a statement prepared by SPI_prepare can be passed as an argument to SPI_cursor_open, or false if that is not the case. π
The criteria are that the plan represents one single command and that this command returns tuples to the caller; for example, SELECT is allowed unless it contains an INTO clause, and UPDATE is allowed only if it contains a RETURNING clause. Lowkey that's the whole vibe check. π
π ARGUMENTS
SPIPlanPtr planβ prepared statement (returned bySPI_prepare). That's your plan, bestie. π«Ά
πΈ RETURN VALUE
Returns true or false to indicate if the plan can produce a cursor or not, with SPI_result set to zero. β¨
If it is not possible to determine the answer (for example, if the plan is NULL or invalid, or if called when not connected to SPI), then SPI_result is set to a suitable error code and false is returned. π No cap, that's the error path.
okay that's the whole page, bestie. This one comes from PostgreSQL 16.15, dated 2026, and it's the SPI_IS_CURSOR_PLAN(3) manual page. mwah ππ«Ά
π¦ where this page comes from
- opensuse-leap 16.0: postgresql16-docs 16.15-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms