Re: [GENERAL] to_json(now()) result doesn't have 'T' separator

2013-12-23 Thread Adrian Klaver
On Mon, Dec 23, 2013 at 5:37 PM, Joe Van Dyk wrote: > I tried making some cast functions as follows, but it doesn't seem to work > properly: > > create or replace function iso_timestamp(timestamptz) returns json as $$ > select ('"' || > substring(xmlelement(name x, $1)::text from 4 for

Re: [GENERAL] to_json(now()) result doesn't have 'T' separator

2013-12-23 Thread Joe Van Dyk
I tried making some cast functions as follows, but it doesn't seem to work properly: create or replace function iso_timestamp(timestamptz) returns json as $$ select ('"' || substring(xmlelement(name x, $1)::text from 4 for 32) || '"' )::json $$ language sql immutable; create c

Re: [GENERAL] to_json(now()) result doesn't have 'T' separator

2013-12-23 Thread Joe Van Dyk
This has been brought up a few times in the past: http://www.postgresql.org/message-id/CAAZKuFZF5=raA=rlncqeg_8gsj9vi4_e-fi1aomk4zp+dxc...@mail.gmail.com http://www.postgresql.org/message-id/ec26f5ce-9f3b-40c9-bf23-f0c2b96e3...@gmail.com Any chance it could be fixed? I can't figure out a way to ea

Re: [GENERAL] to_json(now()) result doesn't have 'T' separator

2013-12-20 Thread Gavin Flower
On 21/12/13 15:27, Joe Van Dyk wrote: On Fri, Dec 20, 2013 at 4:24 PM, Joe Van Dyk > wrote: On Fri, Dec 20, 2013 at 4:18 PM, Joe Van Dyk mailto:j...@tanga.com>> wrote: # select to_json(now()); to_json

Re: [GENERAL] to_json(now()) result doesn't have 'T' separator

2013-12-20 Thread Joe Van Dyk
On Fri, Dec 20, 2013 at 4:24 PM, Joe Van Dyk wrote: > > > On Fri, Dec 20, 2013 at 4:18 PM, Joe Van Dyk wrote: > >> # select to_json(now()); >> to_json >> - >> "2013-12-20 15:53:39.098204-08" >> (1 row) >> >> I'd like to see it output "2013-12-20T15:5

Re: [GENERAL] to_json(now()) result doesn't have 'T' separator

2013-12-20 Thread Joe Van Dyk
On Fri, Dec 20, 2013 at 4:18 PM, Joe Van Dyk wrote: > # select to_json(now()); > to_json > - > "2013-12-20 15:53:39.098204-08" > (1 row) > > I'd like to see it output "2013-12-20T15:53:39.098204-08" so it's > interchangeable with more systems. > Actu

[GENERAL] to_json(now()) result doesn't have 'T' separator

2013-12-20 Thread Joe Van Dyk
# select to_json(now()); to_json - "2013-12-20 15:53:39.098204-08" (1 row) I'd like to see it output "2013-12-20T15:53:39.098204-08" so it's interchangeable with more systems. http://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representation