Expose more cursor-related functionality in SPI: specifically, allow
Tom Lane <tgl@sss.pgh.pa.us>
Expose more cursor-related functionality in SPI: specifically, allow access to the planner's cursor-related planning options, and provide new FETCH/MOVE routines that allow access to the full power of those commands. Small refactoring of planner(), pg_plan_query(), and pg_plan_queries() APIs to make it convenient to pass the planning options down from SPI. This is the core-code portion of Pavel Stehule's patch for scrollable cursor support in plpgsql; I'll review and apply the plpgsql changes separately.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/spi.sgml | modified | +318 −4 |
| src/backend/commands/copy.c | modified | +2 −2 |
| src/backend/commands/explain.c | modified | +6 −6 |
| src/backend/commands/portalcmds.c | modified | +2 −2 |
| src/backend/commands/prepare.c | modified | +2 −2 |
| src/backend/executor/functions.c | modified | +2 −2 |
| src/backend/executor/spi.c | modified | +51 −12 |
| src/backend/optimizer/plan/planner.c | modified | +4 −5 |
| src/backend/parser/gram.y | modified | +8 −9 |
| src/backend/tcop/postgres.c | modified | +12 −9 |
| src/backend/utils/cache/plancache.c | modified | +6 −3 |
| src/include/executor/spi.h | modified | +8 −3 |
| src/include/nodes/parsenodes.h | modified | +7 −6 |
| src/include/optimizer/planner.h | modified | +2 −2 |
| src/include/tcop/tcopprot.h | modified | +5 −4 |