From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org, Amit Langote <amitlangote09@gmail.com>
Subject: Re: CREATE TABLE .. PARTITION OF fails to preserve tgenabled for inherited row triggers
Date: Fri, 16 Jul 2021 18:01:12 -0400
Message-ID: <202107162201.g243c7mnnxuy@alvherre.pgsql> (raw)
In-Reply-To: <20210716193319.GS20208@telsasoft.com>
On 2021-Jul-16, Justin Pryzby wrote:
> CREATE TABLE p(i int) PARTITION BY RANGE(i);
> CREATE TABLE p1 PARTITION OF p FOR VALUES FROM (1)TO(2);
> CREATE FUNCTION foo() returns trigger LANGUAGE plpgsql AS $$begin end$$;
> CREATE TRIGGER x AFTER DELETE ON p1 EXECUTE FUNCTION foo();
> CREATE TRIGGER x AFTER DELETE ON p EXECUTE FUNCTION foo();
Hmm, interesting -- those statement triggers are not cloned, so what is
going on here is just that the psql query to show them is tripping on
its shoelaces ... I'll try to find a fix.
I *think* the problem is that the query matches triggers by name and
parent/child relationship; we're missing to ignore triggers by tgtype.
It's not great design that tgtype is a bitmask of unrelated flags ...
--
Álvaro Herrera Valdivia, Chile — https://www.EnterpriseDB.com/
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: alvherre@alvh.no-ip.org, pryzby@telsasoft.com, tgl@sss.pgh.pa.us, amitlangote09@gmail.com
Subject: Re: CREATE TABLE .. PARTITION OF fails to preserve tgenabled for inherited row triggers
In-Reply-To: <202107162201.g243c7mnnxuy@alvherre.pgsql>
* 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