Search Postgresql Archives

Re: Dynamic function execution?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux