pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: shyamperi@davlin.co.in
Cc: jeanmichel.chabanne@free.fr
Cc: pgsql-admin@postgresql.org
Cc: pgsql-sql@postgresql.org
Subject: Re: Error with functions
Date: Sat, 20 Sep 2003 12:02:20 -0400
Message-ID: <24543.1064073740@sss.pgh.pa.us> (raw)
In-Reply-To: <7144314.1064057032072.JavaMail.tomcat@mail.davlin.co.in>
References: <7144314.1064057032072.JavaMail.tomcat@mail.davlin.co.in>

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



view thread (6+ messages)

Message-ID: <24543.1064073740@sss.pgh.pa.us>
Permalink:  ../24543.1064073740@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/24543.1064073740@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, shyamperi@davlin.co.in, jeanmichel.chabanne@free.fr, pgsql-admin@postgresql.org
  Subject: Re: Error with functions
  In-Reply-To: <24543.1064073740@sss.pgh.pa.us>

* 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