pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Amit Langote <amitlangote09@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: DETACH PARTITION and FOR EACH ROW triggers on partitioned tables
Date: Tue, 21 Apr 2020 11:45:53 -0400
Message-ID: <20200421154553.GA21155@alvherre.pgsql> (raw)
In-Reply-To: <20200420230406.GA27302@alvherre.pgsql>

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





view thread (22+ messages)  latest in thread

Message-ID: <20200421154553.GA21155@alvherre.pgsql>
Permalink:  ../20200421154553.GA21155@alvherre.pgsql/
Also on:    postgresql.org/message-id/20200421154553.GA21155@alvherre.pgsql

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@2ndquadrant.com, pryzby@telsasoft.com, amitlangote09@gmail.com, tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org
  Subject: Re: DETACH PARTITION and FOR EACH ROW triggers on partitioned tables
  In-Reply-To: <20200421154553.GA21155@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