From shyamperi@davlin.co.in Sat Sep 20 06:49:41 2003 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 49242D1B53F; Sat, 20 Sep 2003 06:49:41 +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 81271-01; Sat, 20 Sep 2003 03:49:07 -0300 (ADT) Received: from davlin.co.in (ns.vasnet.net.in [202.4.160.11]) by svr1.postgresql.org (Postfix) with ESMTP id A5920D1B4E5; Sat, 20 Sep 2003 03:49:04 -0300 (ADT) Received: from Application (unknown [202.4.160.30]) by davlin.co.in (Postfix) with ESMTP id B85AE14B70; Sat, 20 Sep 2003 11:54:34 +0530 (IST) Message-ID: <2753631.1064039518784.JavaMail.tomcat@mail.davlin.co.in> From: shyamperi@davlin.co.in To: pgsql-admin@postgresql.org To: pgsql-sql@postgresql.org Subject: Error with functions Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_163_7194891.1064039518632" Date: Sat, 20 Sep 2003 11:54:34 +0530 (IST) X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/326 X-Sequence-Number: 10414 ------=_Part_163_7194891.1064039518632 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hey, create or replace function sample(varchar,int) returns varchar as' declare data alias for $1; size alias for $2; begin return substr(data,(length(data)-size)+1,length(data)); end; ' language 'plpgsql'; ____________________________ WARNING: plpgsql: ERROR during compile of sample near line 2 ERROR: parse error at or near ";" Can any body tell me why is this error coming ----- 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 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_163_7194891.1064039518632 Content-type: text/html Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=Untitled1

Hey,
create or replace function s= ample(varchar,int) returns varchar as'
declare
   &nbs= p;    data alias for $1;
     &n= bsp;  size alias for $2;
begin
     &nb= sp;  return  substr(data,(length(data)-size)+1,length(data));
= end;
' language 'plpgsql';

____________________________
WARNING:&n= bsp; plpgsql: ERROR during compile of sample near line 2
ERROR:  pa= rse error at or near ";"

Can any body tell me why is this error comi= ng

-----
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




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_163_7194891.1064039518632-- From jasiek@klaster.net Sat Sep 20 06:59:50 2003 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 3D314D1B52A for ; Sat, 20 Sep 2003 06:59:50 +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 70642-10 for ; Sat, 20 Sep 2003 03:59:16 -0300 (ADT) Received: from serwer.skawsoft.com.pl (serwer.skawsoft.com.pl [213.25.37.66]) by svr1.postgresql.org (Postfix) with ESMTP id CDC4CD1B4E5 for ; Sat, 20 Sep 2003 03:59:13 -0300 (ADT) Received: from klaster.net (core-1.citynet.pl [80.48.135.69]) by serwer.skawsoft.com.pl (Postfix) with ESMTP id 258272B3D5; Sat, 20 Sep 2003 08:58:52 +0200 (CEST) Message-ID: <3F6BFAB0.2010106@klaster.net> Date: Sat, 20 Sep 2003 08:58:56 +0200 From: Tomasz Myrta User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; pl-PL; rv:1.5a) Gecko/20030718 X-Accept-Language: pl, en-us, en MIME-Version: 1.0 To: shyamperi@davlin.co.in Cc: pgsql-sql@postgresql.org Subject: Re: Error with functions References: <2753631.1064039518784.JavaMail.tomcat@mail.davlin.co.in> In-Reply-To: <2753631.1064039518784.JavaMail.tomcat@mail.davlin.co.in> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/215 X-Sequence-Number: 15193 > Hey, > create or replace function sample(varchar,int) returns varchar as' > declare > data alias for $1; > size alias for $2; > begin > return substr(data,(length(data)-size)+1,length(data)); > end; > ' language 'plpgsql'; > ____________________________ > WARNING: plpgsql: ERROR during compile of sample near line 2 > ERROR: parse error at or near ";" > > Can any body tell me why is this error coming Really? I got no error and select sample('nothing',3) gave mi 'ing' What is your postgresql version? Regards, Tomasz Myrta From shyamperi@davlin.co.in Sat Sep 20 07:25:27 2003 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 12D86D1B4E5 for ; Sat, 20 Sep 2003 07:25:27 +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 82906-08 for ; Sat, 20 Sep 2003 04:25:16 -0300 (ADT) Received: from davlin.co.in (ns.vasnet.net.in [202.4.160.11]) by svr1.postgresql.org (Postfix) with ESMTP id A7E39D1B574 for ; Sat, 20 Sep 2003 04:25:11 -0300 (ADT) Received: from Application (unknown [202.4.160.30]) by davlin.co.in (Postfix) with ESMTP id 83F9A14B70; Sat, 20 Sep 2003 12:30:42 +0530 (IST) Message-ID: <4296516.1064041686563.JavaMail.tomcat@mail.davlin.co.in> From: shyamperi@davlin.co.in To: shyamperi@davlin.co.in To: jasiek@klaster.net Subject: Re: Error with functions Cc: pgsql-sql@postgresql.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_174_933598.1064041686413" Date: Sat, 20 Sep 2003 12:30:42 +0530 (IST) X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/216 X-Sequence-Number: 15194 ------=_Part_174_933598.1064041686413 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hey, PostgreSQL 7.3 on i686-pc-linux-gnu, compiled by GCC 2.96 But, I am getting error when I am using the alias key word.=20 And also when I try to create a C function for the same and excute I am get= ting the following error ERROR: Memory exhausted in AllocSetAlloc(677865842) And, I am allocating memory using the "palloc" ----- 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------------------ > Hey, > create or replace function sample(varchar,int) returns varchar as' > declare > data alias for $1; > size alias for $2; > begin > return substr(data,(length(data)-size)+1,length(data)); > end; > ' language 'plpgsql'; > ____________________________ > WARNING: plpgsql: ERROR during compile of sample near line 2 > ERROR: parse error at or near ";" >=20 > Can any body tell me why is this error coming Really? I got no error and select sample('nothing',3) gave mi 'ing' What is your postgresql version? Regards, Tomasz Myrta 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_174_933598.1064041686413 Content-type: text/html Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=Untitled1

Hey,

PostgreSQL 7.3 on i686-pc-linux-gnu, compiled by GCC 2.96

But, I = am getting error when I am using the alias key word.
And also when I tr= y to create a C function for the same and excute I am getting the following= error

ERROR:  Memory exhausted in AllocSetAlloc(677865842)

And, I am allocating memory using the "palloc"

-----
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------------------
&g=
t; Hey,
> create or replace function sample(varchar,int) returns varchar as'
> declare
>         data alias for $1;
>         size alias for $2;
> begin
>         return  substr(data,(length(data)-size)+1,length(data));
> end;
> ' language 'plpgsql';
> ____________________________
> WARNING:  plpgsql: ERROR during compile of sample near line 2
> ERROR:  parse error at or near ";"
>=20
> Can any body tell me why is this error coming

Really?
I got no error and select sample('nothing',3) gave mi 'ing'
What is your postgresql version?

Regards,
Tomasz Myrta


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_174_933598.1064041686413-- From jeanmichel.chabanne@free.fr Sat Sep 20 07:26:04 2003 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 51734D1B4E5; Sat, 20 Sep 2003 07:26:04 +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 84535-06; Sat, 20 Sep 2003 04:25:33 -0300 (ADT) Received: from postfix4-1.free.fr (postfix4-1.free.fr [213.228.0.62]) by svr1.postgresql.org (Postfix) with ESMTP id 435F8D1B53F; Sat, 20 Sep 2003 04:25:31 -0300 (ADT) Received: from free.fr (lns-p19-9-62-147-243-253.adsl.proxad.net [62.147.243.253]) by postfix4-1.free.fr (Postfix) with ESMTP id 56D6B4C6C4; Sat, 20 Sep 2003 09:25:10 +0200 (CEST) Message-ID: <3F6C01D4.7090000@free.fr> Date: Sat, 20 Sep 2003 09:29:24 +0200 From: Jean-Michel Chabanne User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.3.1) Gecko/20030428 X-Accept-Language: fr, en-us, en MIME-Version: 1.0 To: shyamperi@davlin.co.in Cc: pgsql-admin@postgresql.org, pgsql-sql@postgresql.org Subject: Re: Error with functions References: <2753631.1064039518784.JavaMail.tomcat@mail.davlin.co.in> In-Reply-To: <2753631.1064039518784.JavaMail.tomcat@mail.davlin.co.in> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/327 X-Sequence-Number: 10415 shyamperi@davlin.co.in a écrit : >Hey, >create or replace function sample(varchar,int) returns varchar as' >declare > data alias for $1; > size alias for $2; >begin > return substr(data,(length(data)-size)+1,length(data)); >end; >' language 'plpgsql'; >____________________________ >WARNING: plpgsql: ERROR during compile of sample near line 2 >ERROR: parse error at or near ";" > >Can any body tell me why is this error coming >----- >Warm Regards >Shÿam Peri > >II Floor, Punja Building, >M.G.Road, >Ballalbagh, >Mangalore-575003 >Ph : 91-824-2451001/5 >Fax : 91-824-2451050 > > >DISCLAIMER: This message contains privileged and confidential information and 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. > > > ------------------------------------------------------------------------ > > Hey, > create or replace function sample(varchar,int) returns varchar as' > declare > data alias for $1; > size alias for $2; > begin > return substr(data,(length(data)-size)+1,length(data)); > end; > ' language 'plpgsql'; > > ____________________________ > WARNING: plpgsql: ERROR during compile of sample near line 2 > ERROR: parse error at or near ";" > > Can any body tell me why is this error coming > >----- >Warm Regards >Shÿam Peri > >II Floor, Punja Building, >M.G.Road, >Ballalbagh, >Mangalore-575003 >Ph : 91-824-2451001/5 >Fax : 91-824-2451050 > > > > > > > * DISCLAIMER: This message contains privileged and confidential > information and 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.* > >------------------------------------------------------------------------ > > >---------------------------(end of broadcast)--------------------------- >TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org > > Hi, I juste did a copy/paste of your sample on my test DB. I didn't get any error message and the function works fine. I run PostgreSQL 7.3.3 -- Jean-Michel Chabanne 77450 MONTRY (FRANCE) 48" 54' N - 2" 49' E Powered by Linux From shyamperi@davlin.co.in Sat Sep 20 11:41:11 2003 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 AF2AFD1B584; Sat, 20 Sep 2003 11:41: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 31439-04; Sat, 20 Sep 2003 08:41:03 -0300 (ADT) Received: from davlin.co.in (ns.vasnet.net.in [202.4.160.11]) by svr1.postgresql.org (Postfix) with ESMTP id C3A0DD1B57E; Sat, 20 Sep 2003 08:40:58 -0300 (ADT) Received: from Application (unknown [202.4.160.30]) by davlin.co.in (Postfix) with ESMTP id F1AEF14B78; Sat, 20 Sep 2003 16:46:27 +0530 (IST) Message-ID: <7144314.1064057032072.JavaMail.tomcat@mail.davlin.co.in> From: shyamperi@davlin.co.in To: jeanmichel.chabanne@free.fr Subject: Re: Error with functions Cc: pgsql-admin@postgresql.org Cc: pgsql-sql@postgresql.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_274_664745.1064057031920" Date: Sat, 20 Sep 2003 16:46:28 +0530 (IST) X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/328 X-Sequence-Number: 10416 ------=_Part_274_664745.1064057031920 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 5:08p Dear All, When I am executing any function with parameter.. I am unable to access the= m. So, I would be thankful if, anyone can help me in teaching this aspect. 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. Thank you in advance ----- 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------------------ shyamperi@davlin.co.in a =E9crit : >Hey, >create or replace function sample(varchar,int) returns varchar as' >declare > data alias for $1; > size alias for $2; >begin > return substr(data,(length(data)-size)+1,length(data)); >end; >' language 'plpgsql'; >____________________________ >WARNING: plpgsql: ERROR during compile of sample near line 2 >ERROR: parse error at or near ";" > >Can any body tell me why is this error coming >----- >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 > > >DISCLAIMER: This message contains privileged and confidential information and 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. > > > ------------------------------------------------------------------------ > > Hey, > create or replace function sample(varchar,int) returns varchar as' > declare > data alias for $1; > size alias for $2; > begin > return substr(data,(length(data)-size)+1,length(data)); > end; > ' language 'plpgsql'; > > ____________________________ > WARNING: plpgsql: ERROR during compile of sample near line 2 > ERROR: parse error at or near ";" > > Can any body tell me why is this error coming > >----- >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 > > >=20=20 > > > > * DISCLAIMER: This message contains privileged and confidential=20 > information and is intended only for the individual named.If you are > not the intended recipient you should not=20 > disseminate,distribute,store,print, copy or deliver this=20 > message.Please notify the sender immediately by e-mail if you have=20 > received this e-mail by mistake and delete this e-mail from your system.* > >------------------------------------------------------------------------ > > >---------------------------(end of broadcast)--------------------------- >TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org >=20=20 > Hi, I juste did a copy/paste of your sample on my test DB. I didn't get any=20 error message and the function works fine. I run PostgreSQL 7.3.3 --=20 Jean-Michel Chabanne 77450 MONTRY (FRANCE) 48" 54' N - 2" 49' E Powered by Linux 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_274_664745.1064057031920 Content-type: text/html Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=Untitled1

5:08p
Dear All,
When I am executing any function with parame= ter.. I am unable to access them. So, I would be thankful if, anyone can he= lp me in teaching this aspect.

CREATE FUNCTION add_one (integer) RET= URNS INTEGER AS '
    BEGIN
    &n= bsp;   RETURN $1 + 1;
    END;
' LANGUAGE 'p= lpgsql';

The expected ouput of the above function should be 11 when we pass the 1= 0 to it.... but it returns 1.
Thank you in advance

-----
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------------------
sh=
yamperi@davlin.co.in a =E9crit :

>Hey,
>create or replace function sample(varchar,int) returns varchar as'
>declare
>        data alias for $1;
>        size alias for $2;
>begin
>        return  substr(data,(length(data)-size)+1,length(data));
>end;
>' language 'plpgsql';
>____________________________
>WARNING:  plpgsql: ERROR during compile of sample near line 2
>ERROR:  parse error at or near ";"
>
>Can any body tell me why is this error coming
>-----
>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
>
>
>DISCLAIMER: This message contains privileged and confidential
information and 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.
>
>
>
------------------------------------------------------------------------
>
> Hey,
> create or replace function sample(varchar,int) returns varchar as'
> declare
>         data alias for $1;
>         size alias for $2;
> begin
>         return  substr(data,(length(data)-size)+1,length(data));
> end;
> ' language 'plpgsql';
>
> ____________________________
> WARNING:  plpgsql: ERROR during compile of sample near line 2
> ERROR:  parse error at or near ";"
>
> Can any body tell me why is this error coming
>
>-----
>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
>
>
>=20=20
>
>
>
> * DISCLAIMER: This message contains privileged and confidential=20
> information and is intended only for the individual named.If you are

> not the intended recipient you should not=20
> disseminate,distribute,store,print, copy or deliver this=20
> message.Please notify the sender immediately by e-mail if you have=20
> received this e-mail by mistake and delete this e-mail from your
system.*
>
>------------------------------------------------------------------------
>
>
>---------------------------(end of
broadcast)---------------------------
>TIP 1: subscribe and unsubscribe commands go to
majordomo@postgresql.org
>=20=20
>
Hi,

I juste did a copy/paste of your sample on my test DB. I didn't get
any=20
error message and the function works fine.

I run PostgreSQL 7.3.3



--=20
Jean-Michel Chabanne
77450 MONTRY (FRANCE)
48" 54' N - 2" 49' E
Powered by Linux


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_274_664745.1064057031920-- From tgl@sss.pgh.pa.us Sat Sep 20 16:02:59 2003 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