pgsql: Move portal pinning from PL/pgSQL to SPI

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема pgsql: Move portal pinning from PL/pgSQL to SPI
Дата
Msg-id E1eZIDp-0002KY-I8@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Move portal pinning from PL/pgSQL to SPI

PL/pgSQL "pins" internally generated (unnamed) portals so that user code
cannot close them by guessing their names.  This logic is also useful in
other languages and really for any code.  So move that logic into SPI.
An unnamed portal obtained through SPI_cursor_open() and related
functions is now automatically pinned, and SPI_cursor_close()
automatically unpins a portal that is pinned.

In the core distribution, this affects PL/Perl and PL/Python, preventing
users from manually closing cursors created by spi_query and
plpy.cursor, respectively.  (PL/Tcl does not currently offer any cursor
functionality.)

Reviewed-by: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b3617cdfbba1b5381e9d1c6bc0839500e8eb7273

Modified Files
--------------
src/backend/executor/spi.c   | 9 +++++++++
src/pl/plpgsql/src/pl_exec.c | 8 --------
2 files changed, 9 insertions(+), 8 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: pgsql: Give more accurate error message for dropping pinned portal
Следующее
От: Robert Haas
Дата:
Сообщение: pgsql: Add missing "return" statement to accumulate_append_subpath.