Re: Call dynamic PL/PGSQL function - Mailing list pgsql-general

From Richard Huxton
Subject Re: Call dynamic PL/PGSQL function
Date
Msg-id 428C8ACB.3050402@archonet.com
Whole thread Raw
In response to Call dynamic PL/PGSQL function  (Hannes Dorbath <light@theendofthetunnel.de>)
List 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

pgsql-general by date:

Previous
From: John DeSoi
Date:
Subject: Re: 8.0.3 build error on Mac OS X 10.4
Next
From: Maribel Pérez Engroñatt
Date:
Subject: Ayuda con postgresql