Re: Timestamp/Interval proposals: Part 2 - Mailing list pgsql-hackers

From Karel Zak
Subject Re: Timestamp/Interval proposals: Part 2
Date
Msg-id 20020610154334.C1475@zf.jcu.cz
Whole thread Raw
In response to Re: Timestamp/Interval proposals: Part 2  (Hannu Krosing <hannu@tm.ee>)
Responses Re: Timestamp/Interval proposals: Part 2  (Hannu Krosing <hannu@tm.ee>)
Re: Timestamp/Interval proposals: Part 2  (Fduch the Pravking <fduch@antar.bryansk.ru>)
List 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 definedas number in range 1..12.The to_char() convert
date/timedata to string and not to better formatted interval. The right name for your request is to_interval(). TODO?
 
   Karel

-- Karel Zak  <zakkr@zf.jcu.cz>http://home.zf.jcu.cz/~zakkr/C, PostgreSQL, PHP, WWW, http://docs.linux.cz,
http://mape.jcu.cz


pgsql-hackers by date:

Previous
From: NunoACHenriques
Date:
Subject: Re: tuplesort: unexpected end of data
Next
From: Tom Lane
Date:
Subject: Re: Missing types in C header files