Re: Create functions using a function

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Create functions using a function
Date: 2010-03-06 07:55:44
Message-ID: hmt1q0$9u8$1@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 2010-03-01, Gianvito Pio <pio(dot)gianvito(at)gmail(dot)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;

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Jasen Betts 2010-03-06 08:02:42 Re: Does IMMUTABLE property propagate?
Previous Message Petru Ghita 2010-03-06 02:44:20 Does IMMUTABLE property propagate?