Add comments for a UDX

You can comment on UDXs by using the COMMENT ON command capability. For example:
COMMENT ON FUNCTION <function name> (<argument type list>) IS 'text'
COMMENT ON AGGREGATE <aggregate name> (<argument type list>) IS 'text'
COMMENT ON LIBRARY <library name> IS 'text'

A Netezza Performance Server SQL query user can display these comments by using the nzsql \dd <name> command switch, or the \dd switch, which shows all comments for all functions.

You may want to create comments for all UDXs including information about the author, version, and description similar to the following format:
COMMENT ON FUNCTION <function name> (<argument type list>) IS 
'Author: <name> 
Version: <version> 
Description: <description>';
For example:
COMMENT ON FUNCTION CustomerName(varchar(64000)) IS 'Author: name 
Version: 1.0 Description: Sample UDF from Dev Guide';

To comment on a UDX, you must either be the Netezza Performance Server admin user, the owner of the UDX, or you must have COMMENT privileges for the objects. For more information about COMMENT ON, see the IBM® Netezza® Database User’s Guide.

For UDFs and UDAs, make sure that you specify a full signature name (argument type list), including correct sizes for numeric and string data types. Otherwise, you receive an error similar to the message:
Error:  CommentAggregate: existing UDX name(argument type list) 
differs in size of string/numeric arguments