Question: what is proper way to define python function as event_trigger?

From: Andrei Pozolotin <andrei(dot)pozolotin(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Question: what is proper way to define python function as event_trigger?
Date: 2019-12-22 22:27:02
Message-ID: 0d6c5bdc3ab532bc3240cfb14bc55ce9@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello.

Problem:

1. any attempt to define python function as an event_trigger, i.e.:

CREATE FUNCTION public.verify()
RETURNS event_trigger
LANGUAGE 'plpython3u'
AS $$ print("hello-kitty") $$;

2. fails with message:

ERROR: trigger functions can only be called as triggers

SQL state: 0A000

3. here in the source:

https://github.com/postgres/postgres/blob/master/src/pl/plpython/plpy_procedure.c#L226

Question:

what is proper way to define python function as event_trigger?

Thank you.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Ross 2019-12-22 23:07:13 Re: Question: what is proper way to define python function as event_trigger?
Previous Message Adrian Klaver 2019-12-22 22:23:45 Re: Semi-unable to add new records to table--primary key needed?