Re: mogrify and indent features for jsonb

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Petr Jelinek <petr(at)2ndquadrant(dot)com>, Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: mogrify and indent features for jsonb
Date: 2015-03-01 15:49:58
Message-ID: 54F33526.80806@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 03/01/2015 05:03 AM, Petr Jelinek wrote:
> On 23/02/15 18:15, Dmitry Dolgov wrote:
>> Hi, Petr, thanks for the review.
>>
>> >>> I think it would be better if the ident printing didn't put the
>> start of array ([) and start of dictionary ({) on separate line
>> Did you mean this?
>>
>> [
>> {
>> "a": 1,
>> "b": 2
>> }
>> ]
>>
>> I tried to verify this in several ways (http://jsonprettyprint.com/,
>> "JSON.stringify", "json.too" from python), and I always get this result
>> (new line after ([) and ({) ).
>
> No, I mean new lines before the ([) and ({) - try pretty printing
> something like '{"a":["b", "c"], "d": {"e":"f"}}' using that tool you
> pasted and see what your patch outputs to see what I mean.
>
>

Please try this patch and see if it's doing what you want.

cheers

andrew

Attachment Content-Type Size
jsonbxcore3.patch text/x-patch 59.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2015-03-01 16:27:33 Re: pgsql: Invent a memory context reset/delete callback mechanism.
Previous Message Stephen Frost 2015-03-01 15:41:31 Re: Bug in pg_dump