Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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

pgsql-interfaces by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group