Fix jsonpath .split_part() to honor silent mode
Michael Paquier <michael@paquier.xyz>
Fix jsonpath .split_part() to honor silent mode The jsonpath .split_part() method passed its field-position argument through numeric_int4(), that can fail hard if called directly. This commit switches the code to use numeric_int4_safe() with an error context for soft reporting, so as the overflow and zero field-position cases can be handled in silent mode. Oversight in bd4f879a9cdd. Author: Chao Li <li.evan.chao@gmail.com> Reviewed-by: Nazir Bilal Yavuz <byavuz81@gmail.com> Discussion: https://postgr.es/m/FCF996D0-580B-431C-8DE1-A540C58E444C@gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/jsonpath_exec.c | modified | +16 −3 |
| src/test/regress/expected/jsonb_jsonpath.out | modified | +14 −0 |
| src/test/regress/sql/jsonb_jsonpath.sql | modified | +4 −0 |
Discussion
- Fix jsonpath .split_part() to honor silent mode 5 messages · 2026-05-12 → 2026-05-14