Re: Timestamp/Interval proposals: Part 2

From: Hannu Krosing <hannu(at)tm(dot)ee>
To: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
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 14:26:47
Message-ID: 1023719207.4092.31.camel@taru.tm.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 2002-06-10 at 10:49, Karel Zak wrote:
>
> > > I'm _sure_ that to_char() is there for interval.
> > >
> > > testt=# select to_char('33s 15h 10m 5month'::interval, 'HH:MI:SS Month');
> > > to_char
> > > --------------------
> > > 03:10:33 May
> > > (1 row)
> >
> > Does "May" make sense for an _interval _ ? (Feb 22 + May = Jul 22)?
> >
> > Would not "5 months" make more sense ?
>
> 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'

> > Or is it some ISO standard ?

Does anyone know what standard says about interval formats?

------------
annu

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Cramer 2002-06-10 16:21:42 Re: Roadmap for a Win32 port cross platform admin tool
Previous Message Dave Page 2002-06-10 14:10:31 ALTER TABLE... OWNER bugette