pgsql: Rationalize and document pltcl's handling of magic ".tupno" arra

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Rationalize and document pltcl's handling of magic ".tupno" arra
Дата
Msg-id E1c3TLn-0001WY-4m@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Rationalize and document pltcl's handling of magic ".tupno" array element.

For a very long time, pltcl's spi_exec and spi_execp commands have had
a behavior of storing the current row number as an element of output
arrays, but this was never documented.  Fix that.

For an equally long time, pltcl_trigger_handler had a behavior of silently
ignoring ".tupno" as an output column name, evidently so that the result
of spi_exec could be used directly as a trigger result tuple.  Not sure
how useful that really is, but in any case it's bad that it would break
attempts to use ".tupno" as an actual column name.  We can fix it by not
checking for ".tupno" until after we check for a column name match.  This
comports with the effective behavior of spi_exec[p] that ".tupno" is only
magic when you don't have an actual column named that.

In passing, wordsmith the description of returning modified tuples from
a pltcl trigger.

Noted while working on Jim Nasby's patch to support composite results
from pltcl.  The inability to return trigger tuples using ".tupno" as
a column name is a bug, so back-patch to all supported branches.

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/9c0b04f18b2f9cf0a56f6dc97f506b21a6a041c3

Modified Files
--------------
doc/src/sgml/pltcl.sgml | 54 ++++++++++++++++++++++++++++++++-----------------
src/pl/tcl/pltcl.c      | 23 +++++++++++++--------
2 files changed, 50 insertions(+), 27 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Rationalize and document pltcl's handling of magic ".tupno" arra
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Rationalize and document pltcl's handling of magic ".tupno" arra