pgsql: Disallow invalid path elements in jsonb_set - Mailing list pgsql-committers

From Andrew Dunstan
Subject pgsql: Disallow invalid path elements in jsonb_set
Date
Msg-id E1ZinOr-0002zg-NU@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Disallow invalid path elements in jsonb_set

Null path elements and, where the object is an array, invalid integer
elements now cause an error.

Incorrect behaviour noted by Thom Brown, patch from Dmitry Dolgov.

Backpatch to 9.5 where jsonb_set was introduced

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/1edd4ec831458e10b524d1473a7de5791aa8753e

Modified Files
--------------
src/backend/utils/adt/jsonfuncs.c     |    5 ++++-
src/test/regress/expected/jsonb.out   |   24 +++++++++---------------
src/test/regress/expected/jsonb_1.out |   24 +++++++++---------------
src/test/regress/sql/jsonb.sql        |    3 +++
4 files changed, 25 insertions(+), 31 deletions(-)


pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: pgsql: Group cluster_name and update_process_title settings together
Next
From: Andrew Dunstan
Date:
Subject: pgsql: Disallow invalid path elements in jsonb_set