Andrew Gould <andrewgould(at)yahoo(dot)com> writes:
> Once I untar PostgreSQL's source, where can I find the
> code for avg()? Will it have it's own file?
The C code is in src/backend/utils/adt/float.c --- look at
float8_accum() and float8_avg().
regards, tom lane