Adding callback support.

Поиск
Список
Период
Сортировка
От Nicolai Petri
Тема Adding callback support.
Дата
Msg-id 200505100936.59913.lists@petri.cc
обсуждение исходный текст
Ответы Re: Adding callback support.  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
Список pgsql-hackers
Hi ppl,

I'm currently building some stored procedures in C that uses some internal 
hash tables - It could be really nice to be able to deallocate those 
correctly when e.g. a memctx is destroyed. Would it be possible to add this 
as a postgresql feature and how should it be done.

I also have some other tasks where I would like to do specific actions when a 
transaction completes or aborts. This could be used for maintaining a 
pgmemcache correctly and many other cases. Could this be combined with the 
above feature so a generic callback framework was added ? 

I was thinking something like :register_callback(my_func, (void*) myprivatedata, CB_ON_TRNSACT_OK|CB_ON_TRNSACT_ABORT
);

Other flags could be on CB_ON_QUERY_DONE/ABORTED, CB_ON_CONNETION_CLOSED

I wouldn't mind trying to do patches if they would be accepted for 8.1 or 8.2 
but I would if we could settle for an API before I start coding anything.

---
Nicolai Petri





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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Hashagg planning bug (8.0.1)
Следующее
От: Rod Taylor
Дата:
Сообщение: Re: Hashagg planning bug (8.0.1)