pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrei Pozolotin <andrei.pozolotin@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Question: what is proper way to define python function as event_trigger?
Date: Sun, 22 Dec 2019 16:27:02 -0600
Message-ID: <0d6c5bdc3ab532bc3240cfb14bc55ce9@gmail.com> (raw)

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.

view thread (6+ messages)  latest in thread

Message-ID: <0d6c5bdc3ab532bc3240cfb14bc55ce9@gmail.com>
Permalink:  ../0d6c5bdc3ab532bc3240cfb14bc55ce9@gmail.com/
Also on:    postgresql.org/message-id/0d6c5bdc3ab532bc3240cfb14bc55ce9@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: andrei.pozolotin@gmail.com
  Subject: Re: Question: what is proper way to define python function as event_trigger?
  In-Reply-To: <0d6c5bdc3ab532bc3240cfb14bc55ce9@gmail.com>
  References: <0d6c5bdc3ab532bc3240cfb14bc55ce9@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox