]> granicus.if.org Git - postgresql/commit
Provide moving-aggregate support for a bunch of numerical aggregates.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 13 Apr 2014 00:33:09 +0000 (20:33 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 13 Apr 2014 00:33:09 +0000 (20:33 -0400)
commit9d229f399e87d2ae7132c2e8feef317ce1479728
treef808e533fa6b89202733e2b8666361dc5482ca97
parenta9d9acbf219b9e96585779cd5f99d674d4ccba74
Provide moving-aggregate support for a bunch of numerical aggregates.

First installment of the promised moving-aggregate support in built-in
aggregates: count(), sum(), avg(), stddev() and variance() for
assorted datatypes, though not for float4/float8.

In passing, remove a 2001-vintage kluge in interval_accum(): interval
array elements have been properly aligned since around 2003, but
nobody remembered to take out this workaround.  Also, fix a thinko
in the opr_sanity tests for moving-aggregate catalog entries.

David Rowley and Florian Pflug, reviewed by Dean Rasheed
13 files changed:
src/backend/utils/adt/int8.c
src/backend/utils/adt/numeric.c
src/backend/utils/adt/timestamp.c
src/include/catalog/catversion.h
src/include/catalog/pg_aggregate.h
src/include/catalog/pg_proc.h
src/include/utils/builtins.h
src/include/utils/int8.h
src/include/utils/timestamp.h
src/test/regress/expected/opr_sanity.out
src/test/regress/expected/window.out
src/test/regress/sql/opr_sanity.sql
src/test/regress/sql/window.sql