Thank you for your work! Your patch looks nice for me. You seem to get the point the issue intended even though the description is very brief.
In addition, there are more compatible relationships by using upper casting. For example, INT1 can be casted to INT2, INT4, INT8 in our Datum system. Also, FLOAT4 can be casted to FLOAT8.
With these compatible relationships, we may use the following priority of function finding.
1) Find a exact matched function
2) Find a compatible function by using upper casting
For example, let us assume that there are two functions:
- INT4 func1(INT4)
- INT8 func1(INT8
When a function call func1(INT4) is issued, the exact matched function func1(INT4) will be retrieved. If there were no func1(INT4), func1(INT8) will be retrieved.
If there are more than one compatible function, it would be great to retrieve a more close compatible function. For example, there are func1(INT2), func1(INT4), and func1(INT8). When func1(INT2) is issued, it would be better to retrieve func1(INT4) instead of func1(INT8) for more computation efficiency.
If you have any suggestion, feel free suggest anything.