4 Missing operators for jsonb in PostgreSQL 9.4, this may contain some errors and bad form so please test that it suits your requirements before using in any production scenario.
9 * deletion using **-** operator
10 * jsonb_delete(jsonb, text)
11 * jsonb_delete(jsonb, text[])
12 * jsonb_delete(jsonb, jsonb)
13 * concatenation using **||** operator
14 * jsonb_concat(jsonb, jsonb)
18 * delete operator **"-"** provided by functions *jsonb_delete(jsonb, text) jsonb_delete(jsonb, text[]) and jsonb_delete(jsonb, jsonb)*
24 Note: When using text type operators on jsonb arrays only elements of type text will be deleted. E.g.
27 TEST=# SELECT '[1, "1", "2", 2]'::jsonb - '2'::text;
33 TEST=# SELECT '[1, "1", "2", 2]'::jsonb - '"2"'::text;
39 TEST=# SELECT '[1, "1", "2", 2]'::jsonb - array['2']::text[];
45 TEST=# SELECT '[1, "1", "2", 2]'::jsonb - array['"2"']::text[];
56 TEST=# SELECT '{"a": 1, "b": 2, "c": 3}'::jsonb - 'b'::text;
62 TEST=# SELECT '{"a": 1, "b": 2, "c": 3}'::jsonb - ARRAY['a','b'];
68 TEST=# SELECT '{"a": 1, "b": 2, "c": 3}'::jsonb - '{"a": 4, "b": 2}'::jsonb;
74 TEST=# SELECT '{"a": 1, "b": 2, "c": 3, "d": {"a": 4}}'::jsonb - '{"d": {"a": 4}, "b": 2}'::jsonb;
80 TEST=# SELECT '{"a": 4, "b": 2, "c": 3, "d": {"a": 4}}'::jsonb - '{"a": 4, "b": 2}'::jsonb;
82 -------------------------
83 {"c": 3, "d": {"a": 4}}
87 * concatenation operator **"||"** provided by function *jsonb_concat(jsonb, jsonb)*
94 TEST=# SELECT '{"a": 1, "b": 2, "c": 3}'::jsonb || '{"a": 4, "b": 2, "d": 4}'::jsonb;
96 ----------------------------------
97 {"a": 4, "b": 2, "c": 3, "d": 4}
100 TEST=# SELECT '["a", "b"]'::jsonb || '["c"]'::jsonb;
106 TEST=# SELECT '[1,2,3]'::jsonb || '[3,4,5]'::jsonb;
112 TEST=# SELECT '{"a": 1, "b": 2, "c": 3}'::jsonb || '[1,2,3]'::jsonb;
114 -------------------------------------
115 [{"a": 1, "b": 2, "c": 3}, 1, 2, 3]
118 TEST=# SELECT '{"a": 1, "b": 2, "c": 3}'::jsonb || '[1,2,3]'::jsonb || '"a"'::jsonb;
120 ------------------------------------------
121 [{"a": 1, "b": 2, "c": 3}, 1, 2, 3, "a"]