Re: jsonb - jsonb operators

Поиск
Список
Период
Сортировка
От Glyn Astill
Тема Re: jsonb - jsonb operators
Дата
Msg-id 633980543.9089780.1452871248184.JavaMail.yahoo@mail.yahoo.com
обсуждение исходный текст
Ответ на Re: jsonb - jsonb operators  (Merlin Moncure <mmoncure@gmail.com>)
Ответы Re: jsonb - jsonb operators  (Dmitry Dolgov <9erthalion6@gmail.com>)
Список pgsql-hackers



----- Original Message -----
> From: Merlin Moncure <mmoncure@gmail.com>
> To: Glyn Astill <glynastill@yahoo.co.uk>
> Cc: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
> Sent: Friday, 15 January 2016, 14:50
> Subject: Re: [HACKERS] jsonb - jsonb operators
> 
> On Fri, Jan 15, 2016 at 7:43 AM, 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?
> 
> It makes sense for simple json objects in your contrived example.
> 
> How would you define complex structures?  What happens when the key
> matches but not the value?
> 


I was thinking of operating on the top level only, if the value doesn't match the pair isn't removed.

For anything more complex you'd have to have more knowledge of the objects, so functions like jsonb_delete_path and
jsonb_setmake more sense.
 



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Proposal: BSD Authentication support
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Truncating/vacuuming relations on full tablespaces