Re: jsonb - jsonb operators
От | Vitaly Burovoy |
---|---|
Тема | Re: jsonb - jsonb operators |
Дата | |
Msg-id | CAKOSWN=oLL2_Ug8VECBZd5Qgvj84O9eFa2xPQ+3gUPgmyfR5fg@mail.gmail.com обсуждение исходный текст |
Ответ на | jsonb - jsonb operators (Glyn Astill <glynastill@yahoo.co.uk>) |
Список | pgsql-hackers |
On 1/15/16, Glyn Astill <glynastill@yahoo.co.uk> wrote: > Hi all, > > I was just looking through the new jsonb operators in the 9.5 release, and > was wondering if there's any future intention to add a delete operator that > removes element/pair matches? I.e. some sort of top-level "jsonb - jsonb" > operator, e.g. > > > # select '{"a":1, "b":2}'::jsonb - '{"b":2, "a":4}'::jsonb; > ?column? > ---------- > {"a": 1} > (1 row) > > Or would this behaviour be classed as incorrect in some way? > > Thanks > Glyn I thing the operator 'jsonb-jsonb' behavior in such case is not obvious. How to understand the result is not like that: # select '{"a":1, "b":2}'::jsonb - '{"b":2, "a":4}'::jsonb; ?column? ---------- {"a": -3, "b": 0} (1 row) P.S.: I guess an _operator_ jsonb+jsonb doesn't exist by the same way… -- Best regards, Vitaly Burovoy
В списке pgsql-hackers по дате отправления: