Re: Using C functions with triggers

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kenny Carruthers <pgmail(at)kennyc(dot)com>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: Using C functions with triggers
Date: 2002-05-06 15:27:08
Message-ID: 5679.1020698828@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Kenny Carruthers <pgmail(at)kennyc(dot)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

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Nigel J. Andrews 2002-05-06 15:31:05 Re: Schemas: status report, call for developers
Previous Message Christof Petig 2002-05-06 12:47:31 Re: [INTERFACES] ECPG: FETCH ALL|n FROM cursor - Memory allocation?