Re: [SQL] SQL error: function round(double precision, integer) does

2005-02-28 Thread Tom Lane
"TJ O'Donnell" <[EMAIL PROTECTED]> writes: > Is there some fundamental reason for round(dp) but round(numeric,int)? I think the main argument against supporting round(dp,int) is that the result would be inherently inexact (at least for int>0). regards, tom lane --

Re: [SQL] SQL error: function round(double precision, integer) does

2005-02-28 Thread Richard Huxton
TJ O'Donnell wrote: I received the following error when executing a SQL statement: SQL error: ERROR: function round(double precision, integer) does not exist In statement: select id,smiles,smarts,parameter,oe_count_matches(smiles,smarts) as count, round((parameter*oe_count_matches(smiles,smarts))

Re: [SQL] SQL error: function round(double precision, integer) does not exist

2005-02-28 Thread Josh Berkus
TJ, > SQL error: > ERROR: function round(double precision, integer) does not exist > http://www.postgresql.org/docs/7.4/static/functions-math.html > show that round(numeric,int) should work ok. > If I use round() without a second argument, it works OK, but > this gives a loss of precision which

Re: [SQL] SQL error: function round(double precision, integer) does not exist

2005-02-28 Thread Din Adrian
the round sintax is round(numeric,int) not round (double,int) you must cast the value into numeric: ex: round (cast(doublecolumn as numeric),2) should work ok Adrian Din, Om Computer & SoftWare On Sun, 27 Feb 2005 15:26:07 -0800, TJ O'Donnell <[EMAIL PROTECTED]> wrote: I received the following err

Re: [SQL] SQL error: function round(double precision, integer) does

2005-02-28 Thread TJ O'Donnell
I got round(numeric,int) working OK, but it's got me thinking (a dangerous thing!). Is there some fundamental reason for round(dp) but round(numeric,int)? Shouldn't they be, at least, consistent, having round(numeric) or round(dp,int)? Am I missing something? Thanks, TJ Michael Fuhr wrote: On Sun,

Re: [SQL] SQL error: function round(double precision, integer) does not

2005-02-28 Thread Christoph Haller
TJ O'Donnell wrote: > > I received the following error when executing a SQL statement: > > SQL error: > ERROR: function round(double precision, integer) does not exist > > In statement: > > select id,smiles,smarts,parameter,oe_count_matches(smiles,smarts) as count, > round((parameter*oe_coun

Re: [SQL] SQL error: function round(double precision, integer) does

2005-02-28 Thread TJ O'Donnell
Thanks everyone. Your tips about casting my arg to round() as ::numeric worked just fine. I guess I was surprised that plpgsql didn't that on it's own! I'm used to too many forgiving c compilers, and such. TJ Christoph Haller wrote: TJ O'Donnell wrote: I received the following error when executi

Re: [SQL] SQL error: function round(double precision, integer) does not exist

2005-02-28 Thread Michael Fuhr
On Sun, Feb 27, 2005 at 03:26:07PM -0800, TJ O'Donnell wrote: > ERROR: function round(double precision, integer) does not exist [snip] > The functions described at: > http://www.postgresql.org/docs/7.4/static/functions-math.html > show that round(numeric