function ave(integer) does not exist - Mailing list pgsql-general

From Benedict Holland
Subject function ave(integer) does not exist
Date
Msg-id CAD+mzoy3tHVFjKsdhPbpyO59y6=TJFCOsTiSxFED+SwdzUTY+A@mail.gmail.com
Whole thread Raw
Responses Re: function ave(integer) does not exist  (hubert depesz lubaczewski <depesz@depesz.com>)
List pgsql-general
Hi All,

This one is confusing. The only difference in my db is that it comes from a user specific template not pg_default.

I run this:




***********************************************************************************************************************************************************
create temp table test (var int);
insert into test (var) values
(1), (2), (3), (4), (5), (6), (243);

select ave(var)
from test;
***********************************************************************************************************************************************************


and I get this as the error:

***********************************************************************************************************************************************************
ERROR:  function ave(integer) does not exist
LINE 1: select ave(var)
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.


********** Error **********

ERROR: function ave(integer) does not exist
SQL state: 42883
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
Character: 8
***********************************************************************************************************************************************************


So why is this happening? I can run a "select sum(var)" and it works.

Thanks,
~Ben

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: seq-scan or index-scan
Next
From: hubert depesz lubaczewski
Date:
Subject: Re: function ave(integer) does not exist