On May 1, 2012, at 20:41, Hannu Krosing <hannu(at)2ndQuadrant(dot)com> wrote:
> Most people don't work in strongly-typed environment, and thus would
> work around such restriction if they need a simple JSON value at the
> other end of the interchange.
>> My personal take it is have it fail since any arbitrary decision to cast
>> to JSON Text is going to make someone unhappy and supposedly they can
>> modify their query so that the result generates whatever format they desire.
> Do you actually have such an experience or is it just a wild guess ?
So even given the semantic differences between an object and a scalar I am better understanding where interpreting JSON as JSON Value makes sense. However, if I convert a record or array to JSON I expect to get a JSON Text even if the there is only a single column or value in the input.
I guess my take is that record -> JSON text while anything else is JSON value. Whether it is worth maiming the special case for record is worthwhile I really do not know but the semantic difference does exist; and record output is a significant aspect of PostgreSQL output.
I get the ease-of-use aspect but also recognize that sometimes being slightly harder to use is worthwhile if you eliminate ambiguities or limit the possibility to make mistakes.
FWIW my background on this topic is more theoretical than experiential though I am an web-application developer by trade and do use some JSON in that capacity.
In response to
pgsql-hackers by date
|Next:||From: Tom Lane||Date: 2012-05-02 02:25:32|
|Subject: Re: Have we out-grown Flex? |
|Previous:||From: Peter Geoghegan||Date: 2012-05-02 01:01:48|
|Subject: Re: proposal: additional error fields|