Re: GSoC 2015: Extra Jsonb functionality - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: GSoC 2015: Extra Jsonb functionality
Date
Msg-id 20150319141255.GD3636@alvh.no-ip.org
Whole thread Raw
In response to Re: GSoC 2015: Extra Jsonb functionality  (Dmitry Dolgov <9erthalion6@gmail.com>)
Responses Re: GSoC 2015: Extra Jsonb functionality  (Thom Brown <thom@linux.com>)
List pgsql-hackers
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}, "f": 3}

This is a bit strange.  Why did "f" get flattened out of "d"?  Is the
resulting document still valid for the purposes of an application using
it?  I think I'd expect the result to be {"b": {"c": 2}, "d": {"f": 3}}

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Thom Brown
Date:
Subject: Re: GSoC 2015: Extra Jsonb functionality
Next
From: Alvaro Herrera
Date:
Subject: Re: How about to have relnamespace and relrole?