Re: PERFORM function in Plpgsql - Mailing list pgsql-general

From Adam Ruth
Subject Re: PERFORM function in Plpgsql
Date
Msg-id F0BBAFD9-9EAE-11D8-B4BB-000A959D1424@intercation.com
Whole thread Raw
In response to PERFORM function in Plpgsql  (Yannick LOUVET <y.louvet@atolcd.com>)
List pgsql-general
On Apr 29, 2004, at 9:22 AM, Yannick LOUVET wrote:

> hello,
>
> i want to call a function (function1() for example )in an other
> function.
> simple,i guess :
>
> ....
> PERFORM function1() ;

You will want to use EXECUTE instead (assuming var_function is a text
variable):

EXECUTE var_function;

You may need to add parenthesis and a select:

EXECUTE 'select ' || var_function || '()';

> .....
>
> it's ok, but the name of my function is a variable like :
>
>
> .....
> var_function := function1();
> .....
> PERFORM var_function;
>
>
> and it doesn't work !!!
> Is it possible to do that ?
>
> thanks
>
>
> version :
> PostgreSQL 7.3.4 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.3.1
> (Mandrake Linux 9.2 3.3.1-1mdk)


pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Date addition using Interval
Next
From: Lonni Friedman
Date:
Subject: Re: vacuumdb is failing with NUMBER OF INDEX TUPLES NOT THE SAME AS HEAP