Re: [BUGS] BUG #1927: incorrect timestamp returned
| От | Tom Lane |
|---|---|
| Тема | Re: [BUGS] BUG #1927: incorrect timestamp returned |
| Дата | |
| Msg-id | 11361.1128740373@sss.pgh.pa.us обсуждение |
| Ответ на | Re: [BUGS] BUG #1927: incorrect timestamp returned (Bruce Momjian <pgman@candle.pha.pa.us>) |
| Ответы |
Re: [BUGS] BUG #1927: incorrect timestamp returned
|
| Список | pgsql-patches |
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Tom Lane wrote:
>> I think it'd probably be better to just fix the rounding during display.
> If we do that, should we remove some the existing JROUND calls in the
> code? I think we have to do this consistently, at least.
Yeah, I was looking at that --- I think most if not all of the existing
JROUND calls ought to go away. Will try to work up a full patch over
the weekend.
> Also, I don't see how rounding is going to fix the problem that the
> value is actually _rounded_ at different stages, meaning when you are
> doing the output you don't know what came in, as outlined by my
> timestamp_in data.
I think the solution is that timestamp_out needs to decide how many
fractional digits it wants to display, and then round off the input
accordingly, *before* it breaks the input down into y/m/d/h/m/s fields.
This "60.00" business is happening because the rounding is done only on
the seconds-and-fractional-seconds field.
regards, tom lane
В списке pgsql-patches по дате отправления: