On Sat, Nov 24, 2001 at 02:24:09PM -0500, Tom Lane wrote:
> Brent Verner <brent@rcfile.org> writes:
> > This patch fixes a problem where extract/date_part returns bad values
> > for microsecond and millisecond parts.
>
> I'm not convinced the existing behavior is wrong. Timestamps are floats
> in PG, and therefore not infinitely precise. Your patch seems to be
> trying to cover this up, but I fear it will only succeed in introducing
> other problems.
Tom is right. If you need non-float microsecond/millisecond you can
use to_char() -- it's news in 7.2:
test=# select to_char('2001-11-24 13:49:12.826833-05'::timestamp, 'MS');
to_char
---------
827
test=# select to_char('2001-11-24 13:49:12.826833-05'::timestamp, 'US');
to_char
---------
826833
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