From: Jasen Betts <jasen@xnet.co.nz>
To: pgsql-sql@postgresql.org
Subject: Re: Create functions using a function
Date: 6 Mar 2010 07:55:44 GMT
Message-ID: <hmt1q0$9u8$1@reversiblemaps.ath.cx> (raw)
References: <5eca56861003011350pdc14fa5l2498c260bf68a90c@mail.gmail.com>
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;
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: jasen@xnet.co.nz
Subject: Re: Create functions using a function
In-Reply-To: <hmt1q0$9u8$1@reversiblemaps.ath.cx>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox