Create functions using a function

From: Gianvito Pio <pio(dot)gianvito(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Create functions using a function
Date: 2010-03-01 21:50:23
Message-ID: 5eca56861003011350pdc14fa5l2498c260bf68a90c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi all,
is there a way to define functions and/or triggers in a function?

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 varchar) RETURNS VOID AS $$
BEGIN
CREATE FUNCTION name ( ) (here "name" should be expanded to the
variable content) RETURNS ....
...

END
$$

Is there a way to do this? Thanks

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Petru Ghita 2010-03-01 22:38:14 Re: Create functions using a function
Previous Message Aron 2010-03-01 16:30:05 Re: Using new.id in the WHERE condition of one UPDATE inside ON INSERT rule