Re: json rendering without pretty option (compact)

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Nicolas Paris <niparisco(at)gmail(dot)com>
Cc: Forums postgresql <pgsql-general(at)postgresql(dot)org>
Subject: Re: json rendering without pretty option (compact)
Date: 2016-10-19 14:22:29
Message-ID: CAHyXU0zASxxSuJHiS6d1P-Y2Uubw5Qrs3dt9A=YaG09b=79DaA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Oct 18, 2016 at 12:00 PM, Nicolas Paris <niparisco(at)gmail(dot)com> wrote:
> Hello,
>
> I want to minimize postgresql json size when I fetch them.
> I translate columnar table to json thought json_build_object/array or even
> row_to_jeon.
>
> While row_to_json do have a "pretty_bool" option, the latter do not. Each
> json object/array I build contains spaces.
>
> Is there a workaround ?
> Is there a plan to add this feature on future version ?

There is gradual movement towards having all the generation functions
being completely compact. Personally I view the pretty flag as being
a legacy setting formatting should be handled by a separate routine,
which would be more expensive but much more flexible.

merlin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Melvin Davidson 2016-10-19 14:34:39 Re: Drop user cascade
Previous Message Alex Ignatov (postgrespro) 2016-10-19 14:03:20 Re: Drop user cascade