"William Anthony Lim" <wei(dot)liang(at)eudoramail(dot)com> writes:
> create or replace function testcall(int4,varchar,bool,int2) return setof record as '
> ...
> select * from testcall(12,'ABCD',true,20000);
> ERROR: function testcall(integer, "unknown", boolean, integer) does not exist
An undecorated integer constant is considered int4 (or int8 or numeric
if large enough), and there's no automatic downcast to int2. You could
write 20000::int2 or some such, but on the whole I'd recommend declaring
the function to take int4 not int2.
regards, tom lane