Re: Add json_object(text[], json[])? - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Add json_object(text[], json[])?
Date
Msg-id 36a88712-7f45-b8b9-dc70-a9823e4a481c@2ndQuadrant.com
Whole thread Raw
In response to Re: Add json_object(text[], json[])?  (Paul A Jungwirth <pj@illuminatedcomputing.com>)
Responses Re: Add json_object(text[], json[])?
List pgsql-hackers
On 10/24/19 12:46 PM, Paul A Jungwirth wrote:
>
> Even still, it may be nice to have a non-aggregate function that lets
> you build nested JSON. But I agree jsonb_object_agg makes it less
> needful.
>


json{b}_build_object and json{b}_build_array are designed for creating
nested json{b}. Not sure if they would work for your purpose. I hadn't
considered something to let you transform keys.


PLV8 is useful for doing more outlandish JSON transformations. Maybe the
Underscore library has something that would be useful here.


cheers


andrew


-- 
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




pgsql-hackers by date:

Previous
From: Kyotaro Horiguchi
Date:
Subject: Re: [HACKERS] WAL logging problem in 9.4.3?
Next
From: Tom Lane
Date:
Subject: Re: define bool in pgtypeslib_extern.h