Yadnyesh Joshi <yadnyesh_joshi@yahoo.com> writes:
> According to the documentation, when "avg" or "stddev" function is used wit=
> h integer arguments, the result is an integer.
Where do you think you read that?
regression=# create table foo(f1 int);
CREATE TABLE
regression=# insert into foo values(1);
INSERT 0 1
regression=# insert into foo values(2);
INSERT 0 1
regression=# insert into foo values(7);
INSERT 0 1
regression=# select avg(f1) from foo;
avg
--------------------
3.3333333333333333
(1 row)
regression=# select stddev(f1) from foo;
stddev
--------------------
3.2145502536643183
(1 row)
regression=#
regards, tom lane