Re: plpgsql - Mailing list pgsql-general

From Pavel Stehule
Subject Re: plpgsql
Date
Msg-id Pine.LNX.4.44.0310200832510.32277-100000@kix.fsv.cvut.cz
Whole thread Raw
In response to plpgsql  (Martin Marques <martin@bugs.unl.edu.ar>)
List pgsql-general
Hello

This works fine. I have PostgreSQL 7.4

CREATE OR REPLACE FUNCTION foo1(int, int) RETURNS int AS '
BEGIN
  RETURN $1 + $2;
END; ' LANGUAGE plpgsql;

CREATE OR REPLACE FUNCTION foo2() RETURNS boolean AS '
DECLARE i int;
BEGIN i := foo1(10,10);
  RETURN i = 20;
END; ' LANGUAGE plpgsql;

testdb011=> \i pokus.sql
CREATE FUNCTION
CREATE FUNCTION
testdb011=> select foo2();
 foo2
------
 t
(1 řádka)





On Sat, 18 Oct 2003, Martin Marques wrote:

> We are trying to make some things work with plpgsql. The problem is that I
> built several functions that call one another, and I thought that the way of
> calling it was just making the assign:
>
> var:=func1(arg1,arg2);
>
> which gave me an error near ")".
>
> Now if I did the same, but like this:
>
> PERFORM ''SELECT func1(arg1,arg2)'';
>
> it didn't give the error anymore. The problem was that the other function
> (func1()) aparently didn't get executed (logs stop at the PERFORM).
>
> Am I doing something wrong?
>
>


pgsql-general by date:

Previous
From: Dennis Gearon
Date:
Subject: Quick quote for Install
Next
From: Harjo Korte
Date:
Subject: Re: ecpg and blob's