On 2010-03-01, Gianvito Pio <pio.gianvito@gmail.com> wrote:
> --001485f44fc07594a40480c43c01
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi all,
> is there a way to define functions and/or triggers in a function?
assuming plpgsql: execute
> For example, can I create a function that takes an argument and defines a
> function that has the name passed as argument to the first function?
>
> Something like this .....
CREATE FUNCTION test (name text) RETURNS VOID AS $$BEGIN
EXECUTE 'CREATE FUNCTION '||quote_ident(name)|| ... END $$ LANGUAGE PLPGSQL;