Re: Re: round - timestamp bug

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: lockhart(at)fourpalms(dot)org, William Boyle <woboyle(at)ieee(dot)org>, garana(at)sinectis(dot)com, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Re: round - timestamp bug
Date: 2001-02-07 16:52:30
Message-ID: 3A817D4E.50E9A464@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> No, the behavior is not platform-specific. I'm on HP-PA:

Hmm. Don't see that on my Linux box :(

We don't have regression tests which cover this case?

> The problem is that we round the fractional seconds part to two digits
> only after we've separated seconds from the other fields. (I imagine
> the code is not even doing that explicitly, but leaving it to sprintf
> to do so.) It would work better if we rounded the entire floating
> timestamp value to two fractional digits before we break it down,
> eg with
> tstamp = rint(tstamp * 100.0) / 100.0;

Sure, that's a possibility. There is already a macro to help do that
sort of thing, but I've not jumped to this solution since we probably
should allow some kind of variable precision on date/time types.

- Thomas

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Josh Berkus 2001-02-07 22:52:48 Bug Report for 7.1 Beta 3
Previous Message Tom Lane 2001-02-07 16:22:46 Re: byteain() doesn't parse correctly