Re: DETACH PARTITION and FOR EACH ROW triggers on partitioned tables

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: Amit Langote <amitlangote09(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: DETACH PARTITION and FOR EACH ROW triggers on partitioned tables
Date: 2020-04-21 15:45:53
Message-ID: 20200421154553.GA21155@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020-Apr-20, Alvaro Herrera wrote:

> + while (HeapTupleIsValid(trigtup = systable_getnext(scan)))
> + {
> + Form_pg_trigger pg_trigger = (Form_pg_trigger) GETSTRUCT(trigtup);
> + ObjectAddress trig;
> +
> + /* Ignore triggers that weren't cloned */
> + if (!OidIsValid(pg_trigger->tgparentid) ||
> + !pg_trigger->tgisinternal ||
> + !TRIGGER_FOR_ROW(pg_trigger->tgtype))
> + continue;

Actually, shouldn't we be checking just "!OidIsValid(pg_trigger->tgparentid)"
here? Surely the other two conditions should already not matter either
way if tgparentid is set. I can't see us starting to clone
for-statement triggers, but I'm not sure I trust the internal marking to
remain one way or the other.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2020-04-21 16:20:38 Re: DETACH PARTITION and FOR EACH ROW triggers on partitioned tables
Previous Message Andres Freund 2020-04-21 15:36:02 Re: design for parallel backup