pgsql: Fix jsonb replace and delete on scalars and empty structures

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix jsonb replace and delete on scalars and empty structures
Date: 2015-05-13 17:56:49
Message-ID: E1Ysatl-0002me-9J@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix jsonb replace and delete on scalars and empty structures

These operations now error out if attempted on scalars, and simply
return the input if attempted on empty arrays or objects. Along the way
we remove the unnecessary cloning of the input when it's known to be
unchanged. Regression tests covering these cases are added.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/3f2cec797ecceb7467e365410506c0817f9d0163

Modified Files
--------------
src/backend/utils/adt/jsonfuncs.c | 88 +++++++++++++--------------------
src/test/regress/expected/jsonb.out | 57 +++++++++++++++++++++
src/test/regress/expected/jsonb_1.out | 57 +++++++++++++++++++++
src/test/regress/sql/jsonb.sql | 16 ++++++
4 files changed, 165 insertions(+), 53 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2015-05-13 18:06:07 pgsql: Fix postgres_fdw to return the right ctid value in EvalPlanQual
Previous Message Dmitry Dolgov 2015-05-13 16:30:38 Re: pgsql: Additional functions and operators for jsonb