Hello. I'm trying to create a generic add function. I have defined a type my_uint and it needs a '+' operator. This operator should work like normal int + int operation. The function is defined expecting arguments (my_uint, anyelement).
I'm confused in retrieving the anyelement type, value and than do the add operation and return the correct value and type. I tried to use PG_GETARG_DATUM, but I don't know how to extract the value from it (should it be a uint32, uint64, float or double). Any tips?