Informix Error -9406: Cannot resolve support function for user-defined aggregate <aggregate-name>.
Cause and resolution
Cannot resolve support function for user-defined aggregate <aggregate-name>.
You attempted to use a built-in aggregate for which the database server could not find an appropriate support function. For example, if you try to use the SUM aggregate on the "new_type" data type, the database server looks for the following operator function:
plus(new_type, new_type)
This error can also occur for a user-defined aggregate when one of the support functions that the CREATE AGGREGATE statement has listed (INIT/ITER/COMBINE/FINAL) is missing.
Make sure that you have the correct support functions for the user-defined aggregate. These functions must be exist and must be registered in the database with CREATE FUNCTION.
</aggregate-name>Oninit® Troubleshooting Guidance
Reasons / Common Causes
-9406 fires when the database server can't find an appropriate support function for a built-in or user-defined aggregate — per the official guidance.
- A built-in aggregate applied to a UDT with no matching operator function — e.g. SUM
on
new_typerequiring aplus(new_type, new_type)function — per the official guidance. - A user-defined aggregate missing one of its listed support functions (INIT/ITER/COMBINE/FINAL), per the official guidance.
Solutions / Resolution
- Make sure the correct support functions exist and are registered with CREATE FUNCTION, per the official guidance.
Examples
Using SUM on a UDT with no plus() function
SELECT SUM(geom_col) FROM tab;
-- -9406 if no plus(new_type, new_type) function is registered
Corrected — registering the missing support function
CREATE FUNCTION plus(c1 new_type, c2 new_type) RETURNING new_type
...;
Diagnostic Checks
- Check the system catalog for the expected support function's exact name/signature, and register it with CREATE FUNCTION if missing.
Related Errors / Related Topics
- -9401 — "Cannot re-define or drop builtin aggregate
." A related aggregate-support error, on forbidden redefinition rather than a missing support function. - -9412 — "Return type of the support function
does not match the aggregate state type." A related aggregate-support-function error, on return-type mismatch rather than the function being entirely missing.
A required support function for the aggregate couldn't be found — register it with CREATE FUNCTION, matching the expected signature.