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 13147D1B4EE; Sat, 20 Sep 2003 16:02:59 +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 77629-01; Sat, 20 Sep 2003 13:02:48 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id B1181D1B56B; Sat, 20 Sep 2003 13:02:46 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id h8KG2KiP024547; Sat, 20 Sep 2003 12:02:20 -0400 (EDT) To: shyamperi@davlin.co.in Cc: jeanmichel.chabanne@free.fr, pgsql-admin@postgresql.org, pgsql-sql@postgresql.org Subject: Re: Error with functions In-reply-to: <7144314.1064057032072.JavaMail.tomcat@mail.davlin.co.in> References: <7144314.1064057032072.JavaMail.tomcat@mail.davlin.co.in> Comments: In-reply-to shyamperi@davlin.co.in message dated "Sat, 20 Sep 2003 16:46:28 +0530" Date: Sat, 20 Sep 2003 12:02:20 -0400 Message-ID: <24543.1064073740@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/330 X-Sequence-Number: 10418 shyamperi@davlin.co.in writes: > CREATE FUNCTION add_one (integer) RETURNS INTEGER AS ' > BEGIN > RETURN $1 + 1; > END; > ' LANGUAGE 'plpgsql'; > The expected ouput of the above function should be 11 when we pass the 10 t= > o it.... but it returns 1. Works fine for me: regression=# CREATE FUNCTION add_one (integer) RETURNS INTEGER AS ' regression'# BEGIN regression'# RETURN $1 + 1; regression'# END; regression'# ' LANGUAGE 'plpgsql'; CREATE FUNCTION regression=# select add_one(10); add_one --------- 11 (1 row) Perhaps you should show us exactly what you did. regards, tom lane