Re: [HACKERS] GSoC 2015: Extra Jsonb functionality

2015-03-23 Thread Jim Nasby
On 3/21/15 12:49 PM, Dmitry Dolgov wrote: > Frankly, I think the whole proposal needs to be rethought with an eye towards supporting and preserving nested elements instead of trying to just flatten everything out. Can you pls show me few examples what do you mean exactly? All the comments oth

Re: [HACKERS] GSoC 2015: Extra Jsonb functionality

2015-03-21 Thread Dmitry Dolgov
> Frankly, I think the whole proposal needs to be rethought with an eye towards supporting and preserving nested elements instead of trying to just flatten everything out. Can you pls show me few examples what do you mean exactly? On 21 March 2015 at 06:51, Jim Nasby wrote: > On 3/19/15 9:07 AM

Re: [HACKERS] GSoC 2015: Extra Jsonb functionality

2015-03-20 Thread Jim Nasby
On 3/19/15 9:07 AM, Thom Brown wrote: > jsonb_to_array > -- >{a, 1, b, c, 2, d, 3, 4} Is there a use-case for the example you've given above, where you take JSON containing objects and arrays, and flatten them out into a one-dimensi

Re: [HACKERS] GSoC 2015: Extra Jsonb functionality

2015-03-20 Thread Dmitry Dolgov
> Would this also be the case for this function?... > # jsonb_add_to_path('{"b": {"c": ["d", "f"]}}'::jsonb, {b, c}::text[], > '{"g":4}'::jsonb); > jsonb_add_to_path > > {"b": {"c": ["d", "f", {"g": 4}]}} Yes, sure (the similar logic already implemented

Re: [HACKERS] GSoC 2015: Extra Jsonb functionality

2015-03-20 Thread Thom Brown
On 20 March 2015 at 11:21, Dmitry Dolgov <9erthali...@gmail.com> wrote: >> Perhaph it's my misunderstanding, but this would seem to be more of an >> intersection operation on keys rather than a delete. > Hm...why? We remove all elements, which are contains in the first and second > jsonb ("f": [4,

Re: [HACKERS] GSoC 2015: Extra Jsonb functionality

2015-03-20 Thread Dmitry Dolgov
> Perhaph it's my misunderstanding, but this would seem to be more of an intersection operation on keys rather than a delete. Hm...why? We remove all elements, which are contains in the first and second jsonb ("f": [4, 5] in this case) from the first one. > Could there be a corresponding jsonb_exc

Re: [HACKERS] GSoC 2015: Extra Jsonb functionality

2015-03-19 Thread Alvaro Herrera
Thom Brown wrote: > On 19 March 2015 at 14:35, Alvaro Herrera wrote: > > Thom Brown wrote: > >> On 19 March 2015 at 14:12, Alvaro Herrera wrote: > >> > Dmitry Dolgov wrote: > >> > > >> >> * jsonb_slice - extract a subset of an jsonb > >> >> Example of usage: > Okay, so it pulls it all

Re: [HACKERS] GSoC 2015: Extra Jsonb functionality

2015-03-19 Thread Thom Brown
On 19 March 2015 at 14:35, Alvaro Herrera wrote: > Thom Brown wrote: >> On 19 March 2015 at 14:12, Alvaro Herrera wrote: >> > Dmitry Dolgov wrote: >> > >> >> * jsonb_slice - extract a subset of an jsonb >> >> Example of usage: >> >> >> >> =# jsonb_slice('{"a": 1, "b": {"c": 2},

Re: [HACKERS] GSoC 2015: Extra Jsonb functionality

2015-03-19 Thread Alvaro Herrera
Thom Brown wrote: > On 19 March 2015 at 14:12, Alvaro Herrera wrote: > > Dmitry Dolgov wrote: > > > >> * jsonb_slice - extract a subset of an jsonb > >> Example of usage: > >> > >> =# jsonb_slice('{"a": 1, "b": {"c": 2}, "d": {"f": 3}}'::jsonb, > >> ARRAY['b', 'f', 'x']); > >> >

Re: [HACKERS] GSoC 2015: Extra Jsonb functionality

2015-03-19 Thread Thom Brown
On 19 March 2015 at 14:12, Alvaro Herrera wrote: > Dmitry Dolgov wrote: > >> * jsonb_slice - extract a subset of an jsonb >> Example of usage: >> >> =# jsonb_slice('{"a": 1, "b": {"c": 2}, "d": {"f": 3}}'::jsonb, >> ARRAY['b', 'f', 'x']); >> >>jsonb_slice >>

Re: [HACKERS] GSoC 2015: Extra Jsonb functionality

2015-03-19 Thread Alvaro Herrera
Dmitry Dolgov wrote: > * jsonb_slice - extract a subset of an jsonb > Example of usage: > > =# jsonb_slice('{"a": 1, "b": {"c": 2}, "d": {"f": 3}}'::jsonb, > ARRAY['b', 'f', 'x']); > >jsonb_slice > --- > {"b": {"c": 2},

Re: [HACKERS] GSoC 2015: Extra Jsonb functionality

2015-03-19 Thread Thom Brown
On 19 March 2015 at 13:23, Dmitry Dolgov <9erthali...@gmail.com> wrote: > Synopsis: Althrough Jsonb was introduced in PostgreSQL 9.4, there are > several functions, that still missing. Partially this missing functionality > was implemented in this extension [1] and the corresponding patch [2]. The

Re: [HACKERS] GSoC 2015: Extra Jsonb functionality

2015-03-19 Thread Dmitry Dolgov
Synopsis: Althrough Jsonb was introduced in PostgreSQL 9.4, there are several functions, that still missing. Partially this missing functionality was implemented in this extension [1] and the corresponding patch [2]. The purpose of this work is to implement the rest of functions accordingly to impo

[HACKERS] GSoC 2015: Extra Jsonb functionality

2015-03-19 Thread Dmitry Dolgov
Hi, everyone I'm Dmitry Dolgov, a phd student at the KemSU, Russia. I would like to submit a proposal to the GSoC about additional jsonb functionality, and I want to get any feedback and thougths about this.