Re: Add json_object(text[], json[])?

From: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>
To: Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com>, Nikita Glukhov <n(dot)gluhov(at)postgrespro(dot)ru>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add json_object(text[], json[])?
Date: 2019-10-25 13:40:18
Message-ID: 36a88712-7f45-b8b9-dc70-a9823e4a481c@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-10-25 13:41:53 Re: define bool in pgtypeslib_extern.h
Previous Message Kyotaro Horiguchi 2019-10-25 13:20:32 Re: [HACKERS] WAL logging problem in 9.4.3?