Re: to_char issue?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: Pg Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: to_char issue?
Date: 2009-09-28 15:31:04
Message-ID: 1284.1254151864@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I wrote:
> Hmm ... it would be expected in the case of a timestamp, but seems
> wrong when the input is interval.

... although actually the documentation defines HH as "hour of day (01-12)"
so it seems that this is per docs; at least, if you wanted to have
intervals behave differently from timestamps then documenting it would
get much messier. If you consider an interval as being time since
midnight then it's not totally insane.

I also find by experiment that it's worked like this since
to_char(interval) was introduced in 7.2.

I'm kind of inclined to leave it as-is, unless someone can show that
Oracle behaves differently.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Bernt M. Johnsen 2009-09-28 16:16:47 Re: BUG #5084: Query gives different number of rows depending on ORDER BY
Previous Message Robert Haas 2009-09-28 15:15:38 Re: BUG #5081: ON INSERT rule does not work correctly