Re: json casts - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: json casts
Date
Msg-id 5384EE0C.3000605@vmware.com
Whole thread Raw
In response to json casts  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: json casts
List pgsql-hackers
On 05/27/2014 10:53 PM, Andrew Dunstan wrote:
> I've been on the receiving end of a couple of mumbles about the fact
> that the JSON rendering code ignores casts of builtin types to JSON.
> This was originally done as an optimization to avoid doing cache lookups
> for casts for things we knew quite well how to turn into JSON values
> (unlike, say, hstore). However, there is at least one concrete case
> where this has some possibly undesirable consequences, namely
> timestamps. Many JSON processors, especially JavaScript/ECMAScript
> processors, require timestamp values to be in ISO 8601 format, with a
> 'T' between the date part and the time part, and thus they barf on the
> output we produce for such values.

I don't understand what ignoring casts of builtin types to JSON means. 
Can you give an example?

- Heikki



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: json casts
Next
From: Andrew Dunstan
Date:
Subject: Re: json casts