Re: Using C functions with triggers - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: Using C functions with triggers
Date
Msg-id 5679.1020698828@sss.pgh.pa.us
Whole thread Raw
In response to Using C functions with triggers  (Kenny Carruthers <pgmail@kennyc.com>)
List 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 by date:

Previous
From: Christof Petig
Date:
Subject: Re: ECPG: FETCH ALL|n FROM cursor - Memory allocation?
Next
From: jtv
Date:
Subject: Re: Using C functions with triggers