Re: hi,i write a function in postgresql source code, how to register this function?

Поиск
Список
Период
Сортировка
От Adrian von Bidder
Тема Re: hi,i write a function in postgresql source code, how to register this function?
Дата
Msg-id 201006162200.59934@fortytwo.ch
обсуждение исходный текст
Ответ на hi,i write a function in postgresql source code, how to register this function?  (sunpeng <bluevaley@gmail.com>)
Список pgsql-general
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

Вложения

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

Предыдущее
От: Szymon Guz
Дата:
Сообщение: Re: Working with pages of data (LIMIT/OFFSET keyword)
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Misunderstanding transactions and locks