Can I declare a function in postgresql which in its input parameter will convert data type of passed parameter. For example:
create or replace function temp(IN var1 integer, IN var2 varchar)
<function body>
select temp('12345','number');
as passed parameter '12345' is a string, I want it to convert directly into integer while passing it to function, something like this:
create or replace function temp(IN var1 ::integer, IN var2 varchar)
<function body>
Is it possible?
Note: I cannot convert value while passing it to the function like this:
select temp('12345'::integer,'number');
I have to convert it in function definition itself.