Re: mogrify and indent features for jsonb

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: mogrify and indent features for jsonb
Date: 2015-02-15 21:43:23
Message-ID: 54E112FB.2060204@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 02/14/2015 10:06 PM, Andrew Dunstan wrote:
>
> Attached is a patch to provide a number of very useful facilities to
> jsonb that people have asked for. These are based on work by Dmitry
> Dolgov in his jsonbx extension, but I take responsibility for any bugs.
>
> The facilities are:
>
> new operations:
>
> concatenation: jsonb || jsonb -> jsonb
> deletion: jsonb - text -> jsonb
> deletion: jsonb - int -> text
>
> new functions:
>
> produce indented text: jsonb_indent(jsonb) -> text
> change an element at a path: jsonb_replace(jsonb, text[], jsonb) ->
> jsonb.
>
>
> It would be relatively trivial to add:
>
> delete an element at a path: jsonb_delete(jsonb, text[]) -> json
>
> and I think we should do that for the sake of completeness.
>
> The docs might need a little extra work, and the indent code
> definitely needs work, which I hope to complete in the next day or
> two, but I wanted to put a stake in the ground.
>

In this version the indent code now works correctly, and there is an
additional delete operator:

jsonb - text[] -> jsonb

Which deletes data at the designated path.

cheers

andrew

Attachment Content-Type Size
jsonbxcore2.patch text/x-patch 57.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christoph Berg 2015-02-15 21:56:37 Re: gcc5: initdb produces gigabytes of _fsm files
Previous Message Emre Hasegeli 2015-02-15 21:25:32 Re: Selectivity estimation for inet operators