Skip site navigation (1) Skip section navigation (2)

Re: timestamp format bug

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Jon Roberts" <Jon(dot)Roberts(at)asurion(dot)com>,<pgsql-hackers(at)postgresql(dot)org>
Subject: Re: timestamp format bug
Date: 2008-01-31 19:47:06
Message-ID: 47A1D15A.EE98.0025.0@wicourts.gov (view raw or flat)
Thread:
Lists: pgsql-hackers
>>> On Thu, Jan 31, 2008 at 12:45 PM, in message
<1A6E6D554222284AB25ABE3229A92762715527(at)nrtexcus702(dot)int(dot)asurion(dot)com>, "Roberts,
Jon" <Jon(dot)Roberts(at)asurion(dot)com> wrote: 

> So on your db, run this query:
> select sub.t1, to_char(t1, 'yyyy-mm-dd hh24:mi:ss.us') as char_t1
> from 
> (
> select timestamp'2008-01-31 12:31:40.500000' as t1
> ) sub
> 
> 
> I bet you get this:
> "2008-01-31 12:31:40.50";"2008-01-31 12:31:40.500000"
 
           t1           |          char_t1
------------------------+----------------------------
 2008-01-31 12:31:40.50 | 2008-01-31 12:31:40.500000
(1 row)
 
> Don't you think it should have two identical columns?
 
No.  Why should the return value of a function influence the input?
 
What would you expect from this query?:
 
select sub.t1, substring(sub.t1 from 2 for 3) as substring_t1
from
(
select 'abcde'::text as t1
) sub
 
> Secondly, this link shows that ms should be 000-999 and us should be
> 000000-999999.
 
Yes.  That seems to me to work fine, as your examples show.
 
-Kevin
 



In response to

Responses

pgsql-hackers by date

Next:From: Kevin GrittnerDate: 2008-01-31 20:00:23
Subject: Re: timestamp format bug
Previous:From: Roberts, JonDate: 2008-01-31 18:45:41
Subject: Re: timestamp format bug

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group