Re: mogrify and indent features for jsonb

From: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
To: Petr Jelinek <petr(at)2ndquadrant(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: mogrify and indent features for jsonb
Date: 2015-04-18 18:35:29
Message-ID: CA+q6zcU8YnRfUvm5DOje4MMTAy9uKMJatveXF8+erirs-scFSQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Sorry for late reply. Here is a slightly improved version of the patch with
the new `h_atoi` function, I hope this implementation will be more
appropriate.

On 13 March 2015 at 23:30, Petr Jelinek <petr(at)2ndquadrant(dot)com> wrote:

> On 01/03/15 16:49, Andrew Dunstan wrote:
>
>>
>> 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.
>>
>>
> Yes, this produces output that looks like what javascript/python produce.
>
>
> (the other stuff I commented about, mainly the h_atoi is still unfixed
> though)
>
>
> --
> Petr Jelinek http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services
>

Attachment Content-Type Size
jsonbxcore4.patch application/octet-stream 59.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2015-04-18 23:24:52 Re: TABLESAMPLE patch
Previous Message Andrew Dunstan 2015-04-18 15:01:08 Re: Buildfarm client version 4.15 released