Peter Eisentraut <[EMAIL PROTECTED]> writes:
>> create function rtest_viewfunc1(int4) returns int4 as
>> 'select count(*) from rtest_view2 where a = $1'
>> language 'sql';
>> + ERROR:  return type mismatch in function: declared to return integer, returns 
>bigint

> Maybe instead of testing for strict equality of the types, test for
> compatibility.

We could try to force-convert the result of an SQL function to the right
thing, I suppose, but I'm worried that that might mask programmer errors
more than it helps.

On the other hand, the equivalent forced conversion happens already in
plpgsql functions; it's only SQL-language functions that are so picky.
Maybe your idea is good.  Anyone else have an opinion?

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly

Reply via email to