Re: Using C functions with triggers

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Using C functions with triggers
Дата
Msg-id 5679.1020698828@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Using C functions with triggers  (Kenny Carruthers <pgmail@kennyc.com>)
Список pgsql-interfaces
Kenny Carruthers <pgmail@kennyc.com> writes:
>     I have an application that uses libpq to communicate with a database.
> From inside my application, I would like to define a 'trigger' and specify a
> function that is in my application as the 'trigger func' parameter. (This is
> all in C) Is this even possible?

You can't run application-side C code in the backend, no.

I think all you really need here are some rules to fire NOTIFY events:
ON INSERT TO mytable DO NOTIFY mytable_event;

and then listen for "mytable_event" notifications.
        regards, tom lane


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

Предыдущее
От: Christof Petig
Дата:
Сообщение: Re: ECPG: FETCH ALL|n FROM cursor - Memory allocation?
Следующее
От: jtv
Дата:
Сообщение: Re: Using C functions with triggers