Re: JSON "pretty" and selecting nested JSON fields - Mailing list pgsql-general

From Merlin Moncure
Subject Re: JSON "pretty" and selecting nested JSON fields
Date
Msg-id CAHyXU0zz6vGjAqE6n+B52cFfL_6VyjRLuJeU=LYvUJ_86qvt9A@mail.gmail.com
Whole thread Raw
In response to JSON "pretty" and selecting nested JSON fields  (Deven Phillips <deven.phillips@gmail.com>)
List pgsql-general
On Mon, Mar 30, 2015 at 12:54 PM, Deven Phillips
<deven.phillips@gmail.com> wrote:
> Hi all,
>
>     I have a query which selects several rows of data, and contained in one
> of those rows is some aggregated JSON data. I am using row_to_json() to make
> the whole output JSON and I am providing "true" for pretty formatting of the
> JSON. The problem that I am seeing is that they nested JSON block is not
> being prettified along with the outer JSON.

It looks like a bug. The 'outer' to_json's pretty print feature should
control the whole structure IMO.  Personally, I think you'll have
better luck rigging another function to do whitespace insertion
formatting.

merlin


pgsql-general by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: Muti-table join and roll-up aggregate data into nested JSON?
Next
From: negrus
Date:
Subject: unrecognized configuration parameter "bdr.connections"