[EMAIL PROTECTED] 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

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to