X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 6C55FD1B8DF for ; Thu, 4 Mar 2004 06:41:49 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 42066-06 for ; Thu, 4 Mar 2004 02:41:32 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 9FF46D1CC97 for ; Thu, 4 Mar 2004 02:41:32 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i246ep2l022337; Thu, 4 Mar 2004 01:40:51 -0500 (EST) To: wei.liang@eudoramail.com Cc: pgsql-sql@postgresql.org Subject: Re: calling function In-reply-to: References: Comments: In-reply-to "William Anthony Lim" message dated "Wed, 03 Mar 2004 22:29:07 -0800" Date: Thu, 04 Mar 2004 01:40:51 -0500 Message-ID: <22336.1078382451@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/31 X-Sequence-Number: 17130 "William Anthony Lim" 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