Re: Dynamic function execution?

Поиск
Список
Период
Сортировка
От Nick Johnson
Тема Re: Dynamic function execution?
Дата
Msg-id F65AC517-AB1D-468C-BCAA-0BAC46A5B8FC@notdot.net
обсуждение исходный текст
Ответ на Re: Dynamic function execution?  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-general
On 14/03/2006, at 10:26 AM, Michael Fuhr wrote:

On Tue, Mar 14, 2006 at 07:21:51AM -0800, Nick Johnson wrote:

On 14/03/2006, at 12:05 AM, Michael Fuhr wrote:

Why do you need to do this?  What problem are you trying to solve?


I want to associate Postgres functions with rows of a table (eg, a  
table column of datatype regproc or regprocedure) and be able to  
execute the function associated with that  row in a query.


Could you post an example?  Others might be interested in seeing
an application of something like that.

The example that's actually driving this is rather stupid (though amusing). I'm building a Postgres based adventure game. Eg, SELECT n(); SELECT look(); etc. I want to be able to execute on_enter, on_exit etc events, the handles to the event functions being stored in the table.

A more sensible example (though not one this will be immediately used for) is something we're doing at my work: The database contains a number of stored procedures implementing 'models' - they're functions that essentially perform data-mining on the database. There's a table that has metadata about each of these models, allowing the system to determine which ones need executing, and when. Being able to directly call them would be useful here, too.

-Nick Johnson

В списке pgsql-general по дате отправления:

Предыдущее
От: Chris
Дата:
Сообщение: Re: Turn OFF Stats of Postgresql
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: Wisconsin Circuit Court Access (WCCA) on