Paul Jungwirth <pj(at)illuminatedcomputing(dot)com> writes:
> Is it legal to define a bunch of functions all called `array_to_hist`
> for the different numeric types, and have them all implemented by the
> same C function?
Sure.
(There is a regression test that objects if we try to do that with
built-in functions, but it's meant to catch accidental errors rather
than intentional overloading. As long as the C code is prepared to
handle all the cases, you can do what you like.)
regards, tom lane