]> granicus.if.org Git - postgresql/commit
Enhancement of SPI to get access to portals
authorJan Wieck <JanWieck@Yahoo.com>
Mon, 21 May 2001 14:22:19 +0000 (14:22 +0000)
committerJan Wieck <JanWieck@Yahoo.com>
Mon, 21 May 2001 14:22:19 +0000 (14:22 +0000)
commitd27f363e3fceb7612997ae89a8fc84de6754a213
tree844989e8d2c1b8f4ab444a5d439eab50142abbf3
parentbe03eb25f34c9c95c400504ef76c8abe0081d09f
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
13 files changed:
src/backend/commands/command.c
src/backend/executor/spi.c
src/include/catalog/catversion.h
src/include/catalog/pg_type.h
src/include/executor/spi.h
src/include/executor/spi_priv.h
src/include/utils/portal.h
src/pl/plpgsql/src/gram.y
src/pl/plpgsql/src/pl_comp.c
src/pl/plpgsql/src/pl_exec.c
src/pl/plpgsql/src/pl_funcs.c
src/pl/plpgsql/src/plpgsql.h
src/pl/plpgsql/src/scan.l