CVSROOT: /home/projects/pgsql/cvsroot
Module name: pgsql
Changes by: wieck@hub.org 01/05/21 10:22:19
Modified files:
src/backend/commands: command.c
src/backend/executor: spi.c
src/include/catalog: catversion.h pg_type.h
src/include/executor: spi.h spi_priv.h
src/include/utils: portal.h
src/pl/plpgsql/src: gram.y pl_comp.c pl_exec.c pl_funcs.c
plpgsql.h scan.l
Log message:
Enhancement of SPI to get access to portals
- New functions to create a portal using a prepared/saved
SPI plan or lookup an existing portal by name.
- Functions to fetch/move from/in portals. Results are placed
in the usual SPI_processed and SPI_tuptable, so the entire
set of utility functions can be used to gain attribute access.
- Prepared/saved SPI plans now use their own memory context
and SPI_freeplan(plan) can remove them.
- Tuple result sets (SPI_tuptable) now uses it's own memory
context and can be free'd by SPI_freetuptable(tuptab).
Enhancement of PL/pgSQL
- Uses generic named portals internally in FOR ... SELECT
loops to avoid running out of memory on huge result sets.
- Support for CURSOR and REFCURSOR syntax using the new SPI
functionality. Cursors used internally only need no explicit
transaction block. Refcursor variables can be used inside
of explicit transaction block to pass cursors between main
application and functions.
Jan