pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: shyamperi@davlin.co.in
To: pgsql-admin@postgresql.org
Subject: Re: error with functions
Date: Mon, 22 Sep 2003 10:18:53 +0530 (IST)
Message-ID: <3793959.1064206578358.JavaMail.tomcat@mail.davlin.co.in> (raw)

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

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





----------------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='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 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, 2.0K) download <head></head><body marginwidth=4 marginheight=4 topmargin=4 leftmargin=4><P>Command: psql test -c "&gt; CREATE FUNCTION add_one (integer) RETURNS INTEGER AS '&nbsp;&nbsp;&nbsp;&nbsp; BEGIN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; REURN $1 + 1;&nbsp;&nbsp;&nbsp;&nbsp; END; ' LANGUAGE 'plpgsql';"</P> <P>Result: CREATE FUNCTION</P> <P>And the function executed perfectly fine.<BR></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> On Mon, 22 Sep 2003 shyamperi@davlin.co.in wrote: &gt; Dear all, &gt; This is about the same problem which I have been facing for the past one week and which I am unable to solve. &gt; I have create a function which return +1 of the argument passed. &gt; Function Definition: &gt; CREATE FUNCTION add_one (integer) RETURNS INTEGER AS ' &gt; BEGIN &gt; RETURN $1 + 1; &gt; END; &gt; ' LANGUAGE 'plpgsql'; &gt; &gt; The output it was giving was always 1, despite any argument ( not string's ofcourse) &gt; When I viewed the function definition in the pg_proc table... &gt; &gt; psql "select proname,prosrc from pg_proc where proname='add_one'" &gt; proname | prosrc &gt; ---------+------------------------------------------------------- &gt; add_one | BEGIN RETURN +1 END; &gt; (1 row) &gt; ______________ &gt; Can any body tell me why is the $1 missing.. &gt; I am using running postgres 7.3.4 in linux envt &gt; Have a grate day How are you creating the function?</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 (12+ messages)  latest in thread

Message-ID: <3793959.1064206578358.JavaMail.tomcat@mail.davlin.co.in>
Permalink:  ../3793959.1064206578358.JavaMail.tomcat@mail.davlin.co.in/
Also on:    postgresql.org/message-id/3793959.1064206578358.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: shyamperi@davlin.co.in
  Subject: Re: error with functions
  In-Reply-To: <3793959.1064206578358.JavaMail.tomcat@mail.davlin.co.in>
  References: <3793959.1064206578358.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