Re: JsonbValue to Jsonb conversion

Поиск
Список
Период
Сортировка
Искать
От
Andrew Dunstan
Тема
Re: JsonbValue to Jsonb conversion
Дата
Msg-id
54220E3F.2060107@dunslane.net
Ответ на
Список
Дерево обсуждения
JsonbValue to Jsonb conversion Dmitry Dolgov <9erthalion6@gmail.com>
Re: JsonbValue to Jsonb conversion Andrew Dunstan <andrew@dunslane.net>
Re: JsonbValue to Jsonb conversion Pavel Stehule <pavel.stehule@gmail.com>
Re: JsonbValue to Jsonb conversion Andrew Dunstan <andrew@dunslane.net>
Re: JsonbValue to Jsonb conversion Pavel Stehule <pavel.stehule@gmail.com>
Re: JsonbValue to Jsonb conversion Pavel Stehule <pavel.stehule@gmail.com>
Re: JsonbValue to Jsonb conversion Tom Lane <tgl@sss.pgh.pa.us>
Re: JsonbValue to Jsonb conversion Pavel Stehule <pavel.stehule@gmail.com>
Re: JsonbValue to Jsonb conversion Pavel Stehule <pavel.stehule@gmail.com>
Re: JsonbValue to Jsonb conversion Andrew Dunstan <andrew@dunslane.net>

On 09/23/2014 12:23 PM, Dmitry Dolgov wrote:
> Hi all,
>
> I'm faced with some troubles about the jsonb implementation, and I 
> hope I'll get little advice =)
> If I understand correctly, an abstract function for jsonb modification 
> should have the following stages:
>
> Jsonb -> JsonbValue -> Modification -> JsonbValue -> Jsonb
>
> One can convert the *JsonbValue* to the *Jsonb* only by 
> *JsonbValueToJsonb* function. So, my question is can be *JsonbValue*, 
> that contains few *jbvBinary* elements, converted to *Jsonb* by this 
> function? It will be very useful, if you want modify only small part 
> of your JsonbValue (e.g. replace value of some key). But when I'm 
> trying to do this, an exception "unknown type of jsonb container" 
> appears. Maybe I missed something? Or is there another approach to do 
> this conversion?


If you can come up with a way of handling the jbvBinary values then by 
all means send a patch.

But this problem is fairly easily worked around by using an iterator 
over the binary value. The attached patch, which is work in progress for 
adding in the currently missing json functions for jsonb, contains a 
sort of example of doing this in jsonb_agg_transfn.

cheers

andrew

В списке pgsql-hackers по дате отправления
От: Michael Paquier
Дата:
От: Peter Geoghegan
Дата:
FAQ