From: | Karel Zak <zakkr(at)zf(dot)jcu(dot)cz> |
---|---|
To: | Hannu Krosing <hannu(at)tm(dot)ee> |
Cc: | 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-10 13:43:34 |
Message-ID: | 20020610154334.C1475@zf.jcu.cz |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Mon, Jun 10, 2002 at 04:26:47PM +0200, Hannu Krosing wrote:
> > to_char() convert interval to 'tm' and make output like this struct,
>
> My point is that to_char-ing intervals by converting them to dates is
> non-intuitive.
>
> It is really confusing to say that an interval of 5 months = "May"
> and 15months == "1 March" ;(
>
> > I don't know what other is possible do with it.
>
> perhaps show them with the precision specified and keep data for bigger
> units in biggest specified unit.
>
> to_char('2years 1min 4sec'::interval, 'MM SS'); ==> '24mon 64sec'
> to_char('2years 1min 4sec'::interval, 'MM MI SS'); ==> '24mon 1min 4sec'
>
Hmmm, but it's really out of to_char(). For example 'MM' is defined
as number in range 1..12.
The to_char() convert date/time data to string and not to better formatted
interval. The right name for your request is to_interval().
TODO?
Karel
--
Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
http://home.zf.jcu.cz/~zakkr/
C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2002-06-10 13:56:27 | Re: Efficient DELETE Strategies |
Previous Message | Christoph Haller | 2002-06-10 13:42:10 | Efficient DELETE Strategies |