pgsql: plpgsql: Apply the too_many_rows check to EXECUTE ... INTO
pgsql: plpgsql: Apply the too_many_rows check to EXECUTE ... INTO
От:
Fujii Masao <fujii@postgresql.org>
Дата:
plpgsql: Apply the too_many_rows check to EXECUTE ... INTO EXECUTE ... INTO without STRICT silently discarded all but the first result row even when plpgsql.extra_warnings or plpgsql.extra_errors included too_many_rows. Although the documented check was not limited to static SQL, dynamic SQL only checked for multiple rows when STRICT was specified. Honor the too_many_rows setting for dynamic SQL as well, reporting a warning or error as configured. STRICT continues to require exactly one row regardless of these settings. Also add a hint to errors reported when EXECUTE ... INTO STRICT returns multiple rows. Do not backpatch, since enabling this check can cause previously successful statements to fail. Author: Jeevan Chalke Reviewed-by: Pavel Stehule Reviewed-by: Fujii Masao Discussion: https://postgr.es/m/CAM2+6=WikOK3t=LN+jhzNBchrO3uy0tzVPuPygnz9yoUTwnb6Q@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/5ffc82103773eea1ab5aa699edc301d4f03de4ce Modified Files -------------- src/pl/plpgsql/src/pl_exec.c | 22 ++++++++++++++++------ src/test/regress/expected/plpgsql.out | 20 ++++++++++++++++++++ src/test/regress/sql/plpgsql.sql | 14 ++++++++++++++ 3 files changed, 50 insertions(+), 6 deletions(-)