Re: jsonb concatenation loses properties on nested objects - Mailing list pgsql-bugs

From Dmitry Dolgov
Subject Re: jsonb concatenation loses properties on nested objects
Date
Msg-id CA+q6zcWHJgZiktOPM+BaMcEQ1ZvdDP=+w8uoqZ2gt7BsQCLGUA@mail.gmail.com
Whole thread Raw
In response to jsonb concatenation loses properties on nested objects  (Phillip Haydon <phillip.haydon@gmail.com>)
List pgsql-bugs
> Is this by design or is it a bug?

It's by design because `jsonb_concat` is a "shallow concatenation" [1].
Here is a related thread in hackers [2]. "Deep concatenation" functionality
is still to be implemented, but you can use `jsonb_deep_extend` from this
extension [3].

[1]
https://wiki.postgresql.org/wiki/What's_new_in_PostgreSQL_9.5#jsonb_.7C.7C_jsonb_.28concatenate_.2F_overwrite.29
[2]

https://www.postgresql.org/message-id/flat/CAM3SWZRcSp1dS0o5gXeepO7k4QxjjO%2Bh_NsRnCA%3Dmx-OEJ8vYQ%40mail.gmail.com#CAM3SWZRcSp1dS0o5gXeepO7k4QxjjO+h_NsRnCA=mx-OEJ8vYQ@mail.gmail.com
[3] https://www.postgresql.org/message-id/55006879.2050601@dunslane.net

pgsql-bugs by date:

Previous
From: Phillip Haydon
Date:
Subject: jsonb concatenation loses properties on nested objects
Next
From: Bruce Momjian
Date:
Subject: Re: BUG #14016: Incomplete documentation of IN subquery expression