Ang Chin Han <angch@bytecraft.com.my> writes:
> If LEAST and GREATEST can accept any number of parameters, wouldn't it
> make sense to code it like the way COALESCE works, rather than defining
> a function for it? This way we don't need define all the various
> functions with different types.
But COALESCE is a special feature hard-wired into the parser. There's
no free lunch --- you pay for your extensibility somewhere.
regards, tom lane