Re: BUG #14178: output of jsonb_object and json_object doesn't match textually

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
Cc: ap(at)zip(dot)com(dot)au, PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #14178: output of jsonb_object and json_object doesn't match textually
Date: 2016-06-07 11:58:59
Message-ID: CAB7nPqQOuV+snOhWCF3enzYVv+66hWCo5ZGjBx1jd14Kb5-EwQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Jun 7, 2016 at 4:55 PM, Thomas Munro
<thomas(dot)munro(at)enterprisedb(dot)com> wrote:
> On Tue, Jun 7, 2016 at 6:54 PM, Michael Paquier
> <michael(dot)paquier(at)gmail(dot)com> wrote:
>> On Tue, Jun 7, 2016 at 3:48 PM, Thomas Munro
>> <thomas(dot)munro(at)enterprisedb(dot)com> wrote:
>>> On Tue, Jun 7, 2016 at 2:40 PM, Michael Paquier
>>> <michael(dot)paquier(at)gmail(dot)com> wrote:
>>>> On Tue, Jun 7, 2016 at 10:42 AM, <ap(at)zip(dot)com(dot)au> wrote:
>>>>> I think json_object should provide similar output. Consistency is nice
>>>>> aesthetically and as being in line with the principle of least surprise.
>>>>> Its lack may lead to possible unpleasant results if anyone tries to deal
>>>>> with a JSON structure as TEXT (for whatever reason).
>>>>
>>>> That's a debatable point, and as any output is legal json it does not
>>>> actually hurt one way or another. However, as json_object has been
>>>> introduced at the same time as jsonb, I'd tend as well to think that
>>>> consistency is a good idea if possible, see the patch attached.
>>>
>>> (It's a shame that json_build_object and json_object_agg also don't
>>> agree on where to put whitespace...)
>>
>> Right, missed that, as well as json_object_two_arg.
>
> One more difference is that json_object_agg uses "{ " and " }" while
> the other functions use "{" and "}".

OK, that would make the entries generated a bit more compact.. Are
there other opinions on the matter?
--
Michael

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2016-06-07 12:21:56 Re: [BUGS] BUG #14155: bloom index error with unlogged table
Previous Message boa 2016-06-07 09:16:18 BUG #14180: Segmentation fault on replication slave