The “my_bit_xor” example is analogous to the SQL Anywhere (SA) built-in BIT_XOR, except it operates only on unsigned integers.
The resulting declaration is:
CREATE AGGREGATE FUNCTION my_bit_xor(IN arg1 UNSIGNED INT) RETURNS UNSIGNED INT ON EMPTY INPUT RETURNS NULL EXTERNAL NAME 'describe_my_bit_xor@my_shared_lib'
Like the my_sum example, my_bit_xor has no associated usage restrictions, and is therefore usable as a simple aggregate or as an OLAP-style aggregate with any kind of a window.