From: | Michael Paquier <michael(dot)paquier(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 00:30:22 |
Message-ID: | CAB7nPqTQ2AmKuV0QZ0i4MKNTsLTZY2A9FcMEnny3072FO74yxg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Wed, Oct 19, 2016 at 2:00 AM, Nicolas Paris <niparisco(at)gmail(dot)com> wrote:
> 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 ?
Not any direct way that I know of :( If you have a lot of spaces in a
JSON blob between each object, it may be worth casting it once to
jsonb. This takes an extra round of conversion overhead though.
> Is there a plan to add this feature on future version ?
I don't recall plans in this area. Maybe there's room for a
jsonb_compact(). core has already jsonb_pretty(), and that would be
what has the less overhead when doing the binary/text conversion.
--
Michael
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2016-10-19 00:39:30 | Re: pg_sample |
Previous Message | Patrick B | 2016-10-19 00:24:10 | pg_sample |