pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: shyamperi@davlin.co.in
To: shyamperi@davlin.co.in
Cc: pgsql-sql@postgresql.org
Subject: Re: Error with functions
Date: Sat, 20 Sep 2003 12:30:42 +0530 (IST)
Message-ID: <4296516.1064041686563.JavaMail.tomcat@mail.davlin.co.in> (raw)

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 try 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ÿam Peri

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





----------------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 ";"
> 
> 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 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.

Attachments:

Untitled1 (text/html, 1.6K) download <head></head><body marginwidth=4 marginheight=4 topmargin=4 leftmargin=4><P>Hey,</P> <P>PostgreSQL 7.3 on i686-pc-linux-gnu, compiled by GCC 2.96<BR><BR>But, I am getting error when I am using the alias key word. <BR>And also when I try to create a C function for the same and excute I am getting the following error</P> <P>ERROR:&nbsp; Memory exhausted in AllocSetAlloc(677865842)</P> <P>And, I am allocating memory using the "palloc"</P><PRE>----- Warm Regards Shÿam Peri II Floor, Punja Building, M.G.Road, Ballalbagh, Mangalore-575003 Ph : 91-824-2451001/5 Fax : 91-824-2451050 </PRE><BR><BR>----------------Original Message------------------<BR><PRE>&gt; Hey, &gt; create or replace function sample(varchar,int) returns varchar as' &gt; declare &gt; data alias for $1; &gt; size alias for $2; &gt; begin &gt; return substr(data,(length(data)-size)+1,length(data)); &gt; end; &gt; ' language 'plpgsql'; &gt; ____________________________ &gt; WARNING: plpgsql: ERROR during compile of sample near line 2 &gt; ERROR: parse error at or near ";" &gt; &gt; 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</PRE></body><br><br><b> 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.</b>

view thread (6+ messages)  latest in thread

Message-ID: <4296516.1064041686563.JavaMail.tomcat@mail.davlin.co.in>
Permalink:  ../4296516.1064041686563.JavaMail.tomcat@mail.davlin.co.in/
Also on:    postgresql.org/message-id/4296516.1064041686563.JavaMail.tomcat@mail.davlin.co.in

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: shyamperi@davlin.co.in
  Subject: Re: Error with functions
  In-Reply-To: <4296516.1064041686563.JavaMail.tomcat@mail.davlin.co.in>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox