Re: calling function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: wei(dot)liang(at)eudoramail(dot)com
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: calling function
Date: 2004-03-04 06:40:51
Message-ID: 22336.1078382451@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Achilleus Mantzios 2004-03-04 07:54:21 Re: Encoding bytea
Previous Message William Anthony Lim 2004-03-04 06:29:07 calling function