Re: Call dynamic PL/PGSQL function

From: Richard Huxton <dev(at)archonet(dot)com>
To: Hannes Dorbath <light(at)theendofthetunnel(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Call dynamic PL/PGSQL function
Date: 2005-05-19 12:47:07
Message-ID: 428C8ACB.3050402@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hannes Dorbath wrote:
> Hi,
> what's the best way in pl/pgsql to call a function with a dynamic name
> from inside another pl/plsql function?
>
> like..
>
> SELECT INTO
> function_name
> name
> FROM
> functions
> WHERE
> bar;
>
> EXECUTE function_name..??

Almost

my_query = ''SELECT '' || function_name ''()'';
EXECUTE my_query;

Also check out the quote_ functions in case you have mixed-case function
names etc.
--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Maribel Pérez Engroñatt 2005-05-19 12:57:14 Ayuda con postgresql
Previous Message John DeSoi 2005-05-19 12:42:26 Re: 8.0.3 build error on Mac OS X 10.4