Greg Stark <stark@mit.edu> writes:
> Perhaps just a warning on CREATE FUNCTION when one of the arguments
> doesn't have an implicit cast from the canonical data type of that
> hierarchy saying perhaps you should consider using that data type and
> let Postgres convert instead of the more specific data type?
This might be a good idea if we could write such a test in a principled
way, but I'm not seeing how. We don't really have a concept of
"canonical data types".
Also, right at the moment it's not clear to me whether there are any
other cases besides integer literal vs smallint argument. I think
that's the only particularly surprising case within the numeric
hierarchy --- and for non-numeric types, the literal is generally going
to start out "unknown" so the whole problem doesn't arise. I feel
uncomfortable trying to invent general-purpose solutions to problems
we have only one instance of ...
regards, tom lane