Is there any reason that int2_sum, int4_sum, and int8_sum are not marked as
being strict? All the other transition functions for sum, and every other
built in aggregation function is marked as strict, as demonstrated with:
select x.proname, t.proname, t.proisstrict
from ((pg_aggregate a left join
pg_proc x on (a.aggfnoid = x.oid)) left join
pg_proc t on (a.aggtransfn = t.oid))
where not t.proisstrict;
proname | proname | proisstrict
---------+----------+-------------
sum | int2_sum | f
sum | int4_sum | f
sum | int8_sum | f
select x.proname, t.proname, t.proisstrict
from ((pg_aggregate a left join
pg_proc x on (a.aggfnoid = x.oid)) left join
pg_proc t on (a.aggtransfn = t.oid))
where x.proname = 'sum';
proname | proname | proisstrict
---------+-------------+-------------
sum | int8_sum | f
sum | int4_sum | f
sum | int2_sum | f
sum | float4pl | t
sum | float8pl | t
sum | cash_pl | t
sum | interval_pl | t
sum | numeric_add | t
(8 rows)
Thanks,
Caleb
---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq