Re: floor function in 7.3b2 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: floor function in 7.3b2
Date
Msg-id 21703.1033482705@sss.pgh.pa.us
Whole thread Raw
In response to floor function in 7.3b2  ("Mario Weilguni" <mario.weilguni@icomedias.com>)
Responses some more minor incompatibilties 7.2 <-> 7.3  (Mario Weilguni <mweilguni@sime.com>)
Re: floor function in 7.3b2  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: floor function in 7.3b2  (Neil Conway <neilc@samurai.com>)
List pgsql-hackers
"Mario Weilguni" <mario.weilguni@icomedias.com> writes:
> I noticed that some of my queries don't work anymore because they're using
> the floor function:
> e.g.: select type, floor(date_part('epoch', dataend)) as ts from
> last_modified
> Why is floor not working anymore?

Mph.  Seems we have floor(numeric) but not floor(float8), and the latter
is what you need here.

You could cast date_part's result to numeric; or perhaps you could use
trunc() which exists in both numeric and float8 flavors.  It's got
different semantics for negative inputs though.

For 7.4 we should take another look at the operator/function set and
fill in this hole and any others like it.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Mario Weilguni"
Date:
Subject: floor function in 7.3b2
Next
From: Bruce Momjian
Date:
Subject: Re: 7.2.3 patching done