Search Postgresql Archives

Re: Dynamic function execution?

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

 



On 3/14/06, Michael Fuhr <mike@xxxxxxxx> 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.

If you go a ways back on the performance list you can see an example. 
It's very simple: there are C functions which you can call which take
the oid and parameters.   Then you can do clever things like do
callbacks in plpgsql a function taking the function argument as a
string and looking up its oid.

to the original poster...it's probably possible.  one way would be to
sanity check pg_proc on the C side (at the least, check the # args). 
there might be better/faster ways though

Merlin


[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