From: | Thomas Lockhart <thomas(at)pgsql(dot)com> |
---|---|
To: | Karel Zak <zakkr(at)zf(dot)jcu(dot)cz> |
Cc: | Fduch the Pravking <fduch(at)antar(dot)bryansk(dot)ru>, Hannu Krosing <hannu(at)tm(dot)ee>, Thomas Lockhart <lockhart(at)fourpalms(dot)org>, josh(at)agliodbs(dot)com, hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Timestamp/Interval proposals: Part 2 |
Date: | 2002-06-11 13:22:55 |
Message-ID: | 3D05F9AF.C40BFFFD@pgsql.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
> > fduch=> SELECT to_char('100days'::interval, 'YYYY-MM-DD HH24:MI:SS');
> > ---------------------
> > 0000-00-10 00:00:00
> I already said it. The to_char() is 'tm' struct interpreter and use
> standard internal PG routines for interval to 'tm' conversion. We can
> talk about why 100days is converted to '10' days and months aren't
> used. I agree this example seems strange. Thomas?
Not sure why 100 is becoming 10, except that the formatting string is
specifying a field width of two characters (right?). And for intervals,
years and months are not interchangable with days so values do not
overflow from days to months fields.
I played around with to_char(interval,text) but don't understand the
behavior either.
- Thomas
From | Date | Subject | |
---|---|---|---|
Next Message | Lee Kindness | 2002-06-11 13:30:05 | Re: [BUGS] Bug #640: ECPG: inserting float numbers |
Previous Message | Jan Wieck | 2002-06-11 13:06:04 | Re: Project scheduling issues (was Re: Per tuple overhead, |