Re: additional json functionality

From: Gavin Flower <GavinFlower(at)archidevsys(dot)co(dot)nz>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, Hannu Krosing <hannu(at)2ndquadrant(dot)com>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, "David E(dot) Wheeler" <david(at)justatheory(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Teodor Sigaev <teodor(at)sigaev(dot)ru>
Subject: Re: additional json functionality
Date: 2013-11-19 18:51:28
Message-ID: 528BB330.7060405@archidevsys.co.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 20/11/13 05:14, Robert Haas wrote:
> On Thu, Nov 14, 2013 at 2:54 PM, Hannu Krosing <hannu(at)2ndquadrant(dot)com> wrote:
>> I am sure you could also devise an json encoding scheme
>> where white space is significant ;)
> I don't even have to think hard. If you want your JSON to be
> human-readable, it's entirely possible that you want it stored using
> the same whitespace that was present on input. There is a valid use
> case for normalizing whitespace, too, of course.
>
> Everyone on this thread who thinks that there is Only One Right Way To
> Do It should take a chill pill. There is, in fact, more than one
> right way to do it.
>
There is only one obvious 'Right Way', and that is 'My Way'! :-)

More seriously, there are obviously variants in what people consider
useful human readable form of JSON output, but it is probably
inefficient to store white space. Which suggests it might be useful to
allow users to store rules so that the output and include the white
space that they want. However, this is non-trivial - for example
Eclipse allows Java/XML source to be formatted in different ways (here
the source files are store with white space), but lacks a couple of
options that I would like. Possibly, JSON output of white space would
be less problematical?

Cheers,
Gavin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Gierth 2013-11-19 18:58:06 Re: UNNEST with multiple args, and TABLE with multiple funcs
Previous Message Andres Freund 2013-11-19 18:51:27 Re: Data corruption issues using streaming replication on 9.0.14/9.2.5/9.3.1