The user-defined aggregate in your SELECT statement specifies a set-up argument. However, the CREATE AGGREGATE statement that defined this aggregate has not specified an INIT support function. The handling of a set-up argument must occur in an INIT function.
You can either call the user-defined aggregate without a set-up argument or implement a set-up argument for the user-defined aggregate. To implement a set-up argument, take the following actions:
- Write an INIT support function that handles the set-up argument. - Register the INIT function (with CREATE FUNCTION).
- Drop the user-defined aggregate (with DROP AGGREGATE).
- redefine the user-defined aggregate (WITH CREATE AGGREGATE), providing the INIT modifier to specify the new INIT support function.