X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 2FA8CD1B575 for ; Mon, 22 Sep 2003 05:02:38 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 29073-10 for ; Mon, 22 Sep 2003 02:02:07 -0300 (ADT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [64.147.171.210]) by svr1.postgresql.org (Postfix) with ESMTP id 346E9D1B546 for ; Mon, 22 Sep 2003 02:02:06 -0300 (ADT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 04C9F352A7; Sun, 21 Sep 2003 22:01:51 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 03A6B35261; Sun, 21 Sep 2003 22:01:51 -0700 (PDT) Date: Sun, 21 Sep 2003 22:01:51 -0700 (PDT) From: Stephan Szabo To: shyamperi@davlin.co.in Cc: pgsql-admin@postgresql.org Subject: Re: error with functions In-Reply-To: <3381225.1064204992385.JavaMail.tomcat@mail.davlin.co.in> Message-ID: <20030921220113.B91581@megazone.bigpanda.com> References: <3381225.1064204992385.JavaMail.tomcat@mail.davlin.co.in> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/336 X-Sequence-Number: 10424 On Mon, 22 Sep 2003 shyamperi@davlin.co.in wrote: > Dear all, > This is about the same problem which I have been facing for the past one week and which I am unable to solve. > I have create a function which return +1 of the argument passed. > Function Definition: > CREATE FUNCTION add_one (integer) RETURNS INTEGER AS ' > BEGIN > RETURN $1 + 1; > END; > ' LANGUAGE 'plpgsql'; > > The output it was giving was always 1, despite any argument ( not string's ofcourse) > When I viewed the function definition in the pg_proc table... > > psql "select proname,prosrc from pg_proc where proname='add_one'" > proname | prosrc > ---------+------------------------------------------------------- > add_one | BEGIN RETURN +1 END; > (1 row) > ______________ > Can any body tell me why is the $1 missing.. > I am using running postgres 7.3.4 in linux envt > Have a grate day How are you creating the function?