Re: Bug #724: Problmes creating aggregate functions in 7.2.1 - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Bug #724: Problmes creating aggregate functions in 7.2.1
Date
Msg-id 17672.1028055715@sss.pgh.pa.us
Whole thread Raw
In response to Bug #724: Problmes creating aggregate functions in 7.2.1  (pgsql-bugs@postgresql.org)
List pgsql-bugs
pgsql-bugs@postgresql.org writes:
> create aggregate aggint4sum (basetype = int4, sfunc = int4_sum, stype = int4);

This doesn't work because there's no int4_sum(int4, int4).

regression=# \df int4_sum
                 List of functions
 Result data type |   Name   | Argument data types
------------------+----------+---------------------
 bigint           | int4_sum | bigint, integer
                               ^^^^^^
(1 row)

You don't get any automatic conversion when defining an aggregate: the
datatypes have to match exactly.

Your other three examples work for me.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: pg_ctl -w option does not behave as documented
Next
From: Tom Lane
Date:
Subject: Re: Patch for Re: [HACKERS] Bug of PL/pgSQL parser