On Fri, 24 Oct 2003, Michael Brusser wrote: > But this seems to work correctly on 7.3.2 and 7.3.4: > psql -c "select round (2.5)" > Password: > round > ------- > 3 > (1 row) > > ============= > > > > I just tried that on my 7.2.4 and 7.4 beta 4 machines and I get 2 for > > round(2.5)
Ackkk. I accidentally tested it on my 7.3.4 box, not my 7.4 beta 4 box. but the output is the same. The original, I believe, had '' marks in it. Anyway, it seems to matter about the ''s in 7.3.x: In pgsql 7.2: select round(2.5::float); round ------- 2 (1 row) select round(2.5::numeric); round ------- 3 (1 row) select round(2.5); <-- would appear to be coerced to float here) round ------- 2 (1 row) select round('2.5'); ERROR: Function 'round(unknown)' does not exist Unable to identify a function that satisfies the given argument types You may need to add explicit typecasts pgsql 7.3.4: select round(2.5::float); round ------- 2 (1 row) select round(2.5::numeric); round ------- 3 (1 row) select round(2.5); <-- would appear to be coerced to numeric round ------- 3 (1 row) select round('2.5'); round ------- 2 (1 row) pgsql 7.4 beta5: behaves the same as 7.3.4 So it would appear to be that the automatic assumptions about what is float and what is numeric changed from 7.2 to 7.3, i.e. it's assumed that numeric is the input type. But I'm just guessing here. ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly