Re: how to write/setup a C trigger function in a background worker

From: David Fetter <david(at)fetter(dot)org>
To: jacques klein <jacques(dot)klei(at)googlemail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: how to write/setup a C trigger function in a background worker
Date: 2015-08-19 17:01:55
Message-ID: 20150819170155.GC16249@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Qingqing Zhou 2015-08-19 17:32:25 Re: Our trial to TPC-DS but optimizer made unreasonable plan
Previous Message Tom Lane 2015-08-19 16:46:35 Badly broken logic in plpython composite-type handling