Hi, On Wednesday 16 June 2010 18.42:25 sunpeng wrote: > hi,i write a function in postgresql source code, how to register this > function? > it is not an aggregate function. > i don't use 34.3"User-Defined Functions" described in > http://www.postgresql.org/docs/8.4/interactive/xfunc.html, i just write > it in postgresql sourcecode, how to register this function to let final > user use? Should i only add one tuple in pg_process table? how to add ? Perhaps, before thinking about the low-level implementation (where you wrote the function): could you describe what you are trying to do and why you think that you can not (or should not) do this with the usual pg extension mechanisms as described in chapter 34 of the documentation? In my experience, PostgreSQL can be made to do almost everything and needs changes to the core code only in very rare cases. If you've already written the code in C, perhaps you can adapt it to work as a DSO as described in chapter 34.9 [1]? I've never done this, but from my understanding a C language module has nearly full access to all server internals, so what you are doing in functions.c should also be possible from an external module. cheers -- vbi [1] <http://www.postgresql.org/docs/8.4/interactive/xfunc-c.html> -- featured product: vim - http://vim.org
Attachment:
signature.asc
Description: This is a digitally signed message part.