X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8192AD9177 for ; Fri, 16 Sep 2005 20:17:22 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 98642-09 for ; Fri, 16 Sep 2005 23:17:19 +0000 (GMT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [64.147.171.210]) by svr1.postgresql.org (Postfix) with ESMTP id 24EAED90A9 for ; Fri, 16 Sep 2005 20:17:20 -0300 (ADT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id DF8DC35534; Fri, 16 Sep 2005 16:17:21 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id DDD66354A6; Fri, 16 Sep 2005 16:17:21 -0700 (PDT) Date: Fri, 16 Sep 2005 16:17:21 -0700 (PDT) From: Stephan Szabo To: Kenneth Dombrowski Cc: pgsql-sql@postgresql.org Subject: Re: plpgsql function not accepting NULL value In-Reply-To: Message-ID: <20050916161605.T93143@megazone.bigpanda.com> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 required=5 tests=[AWL=0.006] X-Spam-Level: X-Archive-Number: 200509/167 X-Sequence-Number: 22714 On Fri, 16 Sep 2005, Kenneth Dombrowski wrote: > I can't get this one to work at all: > > create or replace function update_rate (integer, integer, integer, > integer, numeric, integer) > returns void > as ' > declare > x_admin_id alias for $1; > x_developer_id alias for $2; > x_client_id alias for $3; > x_project_id alias for $4; > x_rate alias for $5; > x_rate_id alias for $6; > x_meta_id alias for $7; > begin > perform update_lastmod (x_meta_id, x_admin_id); > update rates_tbl set > developer_id = x_developer_id , > client_id = x_client_id , > project_id = x_project_id , > rate = x_rate > where rate_id = x_rate_id ; > return ; > end; > ' language plpgsql; > > > invoicer=> select update_rate(1, 1, 10, NULL, numeric '90.00', 6, 216); > ERROR: function update_rate(integer, integer, integer, "unknown", > numeric, integer, integer) does not exist > HINT: No function matches the given name and argument types. You may > need to add explicit type casts. Umm, it looks to me like you're trying to pass 7 parameters to a function that takes 6 in the above.