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