pgsql: Improve error reporting for jsonpath .double() method

From: Alexander Korotkov <akorotkov(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Improve error reporting for jsonpath .double() method
Date: 2020-07-11 00:25:36
Message-ID: E1ju3Ki-00014Y-0m@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Improve error reporting for jsonpath .double() method

When jsonpath .double() method detects that numeric or string can't be
converted to double precision, it throws an error. This commit makes these
errors explicitly express the reason of failure.

Discussion: https://postgr.es/m/CAPpHfdtqJtiSXkP7tOXez18NxhLUH_-75bL8%3DOce4Ki%2Bbv7V6Q%40mail.gmail.com
Author: Alexander Korotkov
Reviewed-by: Tom Lane
Backpatch-through: 12

Branch
------
REL_13_STABLE

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

Modified Files
--------------
src/backend/utils/adt/jsonpath_exec.c | 4 ++--
src/test/regress/expected/jsonb_jsonpath.out | 8 +++++---
src/test/regress/sql/jsonb_jsonpath.sql | 1 +
3 files changed, 8 insertions(+), 5 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alexander Korotkov 2020-07-11 00:25:40 pgsql: Forbid numeric NaN in jsonpath
Previous Message Alexander Korotkov 2020-07-11 00:25:30 pgsql: Improve error reporting for jsonpath .double() method