Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ijDqf-000774-Pq for pgsql-general@arkaria.postgresql.org; Mon, 23 Dec 2019 02:53:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ijDqe-0007aL-Iv for pgsql-general@arkaria.postgresql.org; Mon, 23 Dec 2019 02:53:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ijDqe-0007aE-9d for pgsql-general@lists.postgresql.org; Mon, 23 Dec 2019 02:53:32 +0000 Received: from mail-yb1-xb2a.google.com ([2607:f8b0:4864:20::b2a]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ijDqX-0002x5-4t for pgsql-general@lists.postgresql.org; Mon, 23 Dec 2019 02:53:31 +0000 Received: by mail-yb1-xb2a.google.com with SMTP id f136so3438173ybg.11 for ; Sun, 22 Dec 2019 18:53:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:content-transfer-encoding:date:from:to:subject :in-reply-to:references:message-id:user-agent; bh=hhBlUjpG/7xflcb5hDebkZQfX2b6YQyT80aG+abRzdg=; b=vEk3to5+VxwBuhPZHm/siBgnW0IiHEri5GcQx/nJRAaWEpVCQPtruZzegUPYcoUlBm 48MDpXoh3ocPVGwhNrVv0/bGuH7QJeq63cGGkucElYJJExahxB0UuV/Ld735/mziUtOD rL1w//1eHISiIe4k8ZVMe2IdTF/6X/nk98vWR0JCnUkwXWkwIWEhvJFKb89c3mihdTBB Pq567VIzKl/1m4yi7FxM4vtSy8nBEqlaNgWiqOCFbnwBt6YHYzyCTKo4uXK9Lr8cnQU3 RoVFodB7FTlDIPag1ew+VvWLT14kWTMcDCs51eWWXcG2yGkYviQQ1e/j7idatQqRo1Gl aciw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:content-transfer-encoding:date:from :to:subject:in-reply-to:references:message-id:user-agent; bh=hhBlUjpG/7xflcb5hDebkZQfX2b6YQyT80aG+abRzdg=; b=lB5bVUajypuXlWt02YlY8ZwpHzokEvSfX0HHlqmthJrjWYGqotbVxfpck02Tb3HXiy TphilVpBQaTNJdN5Id2eiWkU2x1JmcEuO+4yJHH14J9B3i470iL9/HdrcArdBt/sccVx dZv3f2pcxk91AfNU1VSlnNaGq0JqZKvGg65uI1z7LJXCM2m8J8hH24KAsWZ/cCKqgKf8 WKjTpNteXnpvxSlqsjUkNKXqGbrkXb+GW3yMAGBuzCRiavR7PhhaCBc2YVZThwfbQlrE oAVJnScInChnDj3nW8Dz8PAZ3IB/PIyzQp89WPcksWaYzI8xZt/BPAXJnpsElpDwDgjF 7Pjw== X-Gm-Message-State: APjAAAWJI+phvrKAJKpaVOLXdcFFK796YBQVgpHyY+zHJTzV6/M3yKU8 8b06GvZDQaBJax+e1M9KDhlLqnnn37M= X-Google-Smtp-Source: APXvYqzR3DPiGse0R+dAbSiWYGjat1E7A1pq4Yj5+MTA+QTXVga+FH0sDi2JDPbP1UjJbexOqnzArA== X-Received: by 2002:a25:4188:: with SMTP id o130mr20056856yba.150.1577069602648; Sun, 22 Dec 2019 18:53:22 -0800 (PST) Received: from mail-cube (c-73-74-24-80.hsd1.il.comcast.net. [73.74.24.80]) by smtp.gmail.com with ESMTPSA id j4sm7190974ywd.103.2019.12.22.18.53.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Dec 2019 18:53:21 -0800 (PST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 22 Dec 2019 20:53:20 -0600 From: Andrei Pozolotin To: pgsql-general@lists.postgresql.org Subject: Re: Question: what is proper way to define python function as event_trigger? In-Reply-To: <9760.1577058006@sss.pgh.pa.us> References: <0d6c5bdc3ab532bc3240cfb14bc55ce9@gmail.com> <9760.1577058006@sss.pgh.pa.us> Message-ID: <4e7649dbb7d058ccc5a492793feca49e@gmail.com> X-Sender: andrei.pozolotin@gmail.com User-Agent: Roundcube Webmail/1.3.10 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Tom, hi: 1. actual use case has to do with: BUG #16177: pg_event_trigger_ddl_commands() returns empty set for ddl_command_start and "drop table" https://www.postgresql.org/message-id/16177-053a34714817c3e1%40postgresql.org 2. I was merely hoping to re-implement pg_event_trigger_ddl_commands as part of python event_trigger 3. do you think "pg_event_trigger_ddl_commands" is any easier to fix then "support event_trigger in python"? Thank you, Andrei On 2019-12-22 17:40, Tom Lane wrote: > Andrei Pozolotin writes: >> 1. any attempt to define python function as an event_trigger, i.e.: > > AFAICS, there's not really any event trigger support in plpython. > That feature has only been built out in the other three PLs. > > Somebody oughta fix this sometime, I guess, but it evidently hasn't > been high priority. If you feel like working on it, you could look > at commits e5dc4cc24d2e1e94ac572a2c64103710bf15d21e (for plperl) > and/or a5036ca998a6058f60913d43a80badfcbb65f5bb (for pltcl). > > regards, tom lane