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 62E33D1B563 for ; Mon, 22 Sep 2003 05:14:11 +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 50892-01 for ; Mon, 22 Sep 2003 02:14:01 -0300 (ADT) Received: from davlin.co.in (ns.vasnet.net.in [202.4.160.11]) by svr1.postgresql.org (Postfix) with ESMTP id 1A74AD1B4FC for ; Mon, 22 Sep 2003 02:13:58 -0300 (ADT) Received: from Application (unknown [202.4.160.30]) by davlin.co.in (Postfix) with ESMTP id BCEDD14B70 for ; Mon, 22 Sep 2003 10:18:53 +0530 (IST) Message-ID: <3793959.1064206578358.JavaMail.tomcat@mail.davlin.co.in> From: shyamperi@davlin.co.in To: pgsql-admin@postgresql.org Subject: Re: error with functions Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_342_5145092.1064206577631" Date: Mon, 22 Sep 2003 10:18:53 +0530 (IST) X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/337 X-Sequence-Number: 10425 ------=_Part_342_5145092.1064206577631 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Command: psql test -c "> CREATE FUNCTION add_one (integer) RETURNS INTEGER = AS ' BEGIN REURN $1 + 1; END; ' LANGUAGE 'plpgsql';" Result: CREATE FUNCTION And the function executed perfectly fine. ----- Warm Regards Sh=FFam Peri II Floor, Punja Building, M.G.Road, Ballalbagh, Mangalore-575003=20 Ph : 91-824-2451001/5 Fax : 91-824-2451050=20 ----------------Original Message------------------ 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=3D'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? DISCLAIMER: This message contains privileged and confidential information a= nd is intended only for the individual named.If you are not the intended recipient you should not disseminate,distribute,store,print, copy or deliver this message.Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. ------=_Part_342_5145092.1064206577631 Content-type: text/html Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=Untitled1

Command: psql test -c "> CREATE FUNCTION add_one (integer) RETU= RNS INTEGER AS '     BEGIN     = ;    REURN $1 + 1;     END; ' LANGUAGE '= plpgsql';"

Result: CREATE FUNCTION

And the function executed perfectly fine.

-----
Warm Regards
Sh=FFam Peri

II Floor, Punja Building,
M.G.Road,
Ballalbagh,
Mangalore-575003=20
Ph : 91-824-2451001/5
Fax : 91-824-2451050=20




----------------Original Message------------------
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=3D'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?


DISCLAIMER: This message contains privileged and confidential information a= nd is intended only for the individual named.If you are not the intended recipient you should not disseminate,distribute,store,print, copy or deliver this message.Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. ------=_Part_342_5145092.1064206577631--