[COMMITTERS] pgsql: Provide an error cursor for "can't call an SRF here" errors.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема [COMMITTERS] pgsql: Provide an error cursor for "can't call an SRF here" errors.
Дата
Msg-id E1d0Won-0003Hd-7A@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Provide an error cursor for "can't call an SRF here" errors.

Since it appears that v10 is going to move the goalposts by some amount
in terms of where you can and can't invoke set-returning functions,
arrange for the executor's "set-valued function called in context that
cannot accept a set" errors to include a syntax position if possible,
pointing to the specific SRF that can't be called where it's located.

The main bit of infrastructure needed for this is to make the query source
text accessible in the executor; but it turns out that commit 4c728f382
already did that.  We just need a new function executor_errposition()
modeled on parser_errposition(), and we're ready to rock.

While experimenting with this, I noted that the error position wasn't
properly reported if it occurred in a plpgsql FOR-over-query loop,
which turned out to be because SPI_cursor_open_internal wasn't providing
an error context callback during PortalStart.  Fix that.

There's a whole lot more that could be done with this infrastructure
now that it's there, but this is not the right time in the development
cycle for that sort of work.  Hence, resist the temptation to plaster
executor_errposition() calls everywhere ... for the moment.

Discussion: https://postgr.es/m/5263.1492471571@sss.pgh.pa.us

Branch
------
master

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

Modified Files
--------------
src/backend/executor/execExpr.c    |  4 +++-
src/backend/executor/execSRF.c     | 16 ++++++++++------
src/backend/executor/execUtils.c   | 33 +++++++++++++++++++++++++++++++++
src/backend/executor/spi.c         |  6 +++---
src/include/executor/executor.h    |  2 ++
src/test/regress/expected/tsrf.out |  6 ++++++
6 files changed, 57 insertions(+), 10 deletions(-)


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

Предыдущее
От: Fujii Masao
Дата:
Сообщение: [COMMITTERS] pgsql: A collection of small fixes for logical replication.
Следующее
От: Fujii Masao
Дата:
Сообщение: [COMMITTERS] pgsql: Improve documentation and comment for quorum-based syncreplicat