Re: how to write/setup a C trigger function in a background worker - Mailing list pgsql-hackers

From David Fetter
Subject Re: how to write/setup a C trigger function in a background worker
Date
Msg-id 20150819170155.GC16249@fetter.org
Whole thread Raw
In response to how to write/setup a C trigger function in a background worker  (jacques klein <jacques.klei@googlemail.com>)
Responses Re: how to write/setup a C trigger function in a background worker  (jacques klein <jacques.klei@googlemail.com>)
List pgsql-hackers
On Wed, Aug 19, 2015 at 05:37:31PM +0200, jacques klein wrote:
> I would like to execute a trigger function (written in C) in one of my
> background workers.
> 
> Didn't figure out how to do that not even if it's possible.

You can write your trigger function in such a way as not to do the
usual check for trigger context, but it might be better to write two
functions, one with the trigger stuff in it, the other, which it
calls, for whatever action you actually want to trigger, and call that
second in your background worker.

Cheers,
David.
-- 
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Badly broken logic in plpython composite-type handling
Next
From: Qingqing Zhou
Date:
Subject: Re: Our trial to TPC-DS but optimizer made unreasonable plan