Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jQv66-0007WW-DW for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Apr 2020 15:46:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jQv64-0007Tv-Ew for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Apr 2020 15:46:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jQv64-0007Tn-7w for pgsql-hackers@lists.postgresql.org; Tue, 21 Apr 2020 15:46:04 +0000 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jQv61-0003Vd-BC for pgsql-hackers@lists.postgresql.org; Tue, 21 Apr 2020 15:46:03 +0000 Received: by mail-qk1-x744.google.com with SMTP id j4so14926581qkc.11 for ; Tue, 21 Apr 2020 08:46:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=qT7UnhBXKmnnGaCcWXVPuwInrSY0/s1Na+P1NLuWN54=; b=tD6MBfu5JCtZAnvMAjVAWh+iWMhr91swE4FIzLXAAXm+gX5QNXehRhSzzZe3J5R5tm jJDJhPHSvyzwdHQOpY9l2849V/PyWZv2JjcOKJX6NeAxIEoUPeeHl8ivWhYhWs9SREAH UVMIrcV6iuEYtwDJKNcUiKJQ6A0/LXhyv1y6zbZmQ1+DxHx2yIw0RxtMnjZ6vFHuyEnG orWb0hsmAo/QeacwMigHl5ATd/K+FZ9KVdvNRaReFXXBLsqBNtwMXXiW3N0E2AlWlMnq /0JVoV5gXSYqwhzWFALcouzStXa8ITk9FwftScjTBQidJNCjBxUK2qXnUOCnKCNFRZrZ 2x1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=qT7UnhBXKmnnGaCcWXVPuwInrSY0/s1Na+P1NLuWN54=; b=KYje4poj9Ipd71djrr+IgmDeVURr5/AGJZ6aC2lSABrxPX6SkJE2vspI7lQmli3Whx nS49d0bO5ew5SRsnZNP5jreedDN86sFzZBE/UQL+F+vB/+FV3aOs+pS3dG5NWE4T6dZY uJuH3HzVpQ5WeG+WDRnjm9+NQUIKZs2kzApnrIbyoJyL9Hlu5+Qc2wxo/3Zy+urp48Wa 1OzFN/BUiSc9+Y8N9R7HUD9lBnHFADz8lURNmAcZPXyUcZ/6EoNo5prYvFszZeDo7KfE SlWYIrZMDbQBCBPJoP1ZiSk+qrtSvaZeV+w14UwUELhBihgjW0ZQi3d5f2CbCuT2QC85 jHTw== X-Gm-Message-State: AGi0PubN1ydBnMdSad+jm/gBL4vUWBhFE5BuyaxtKovFrAP3NMQKhxXL eHioLQc3rVgKQxwSmu/04LLecg== X-Google-Smtp-Source: APiQypLNLHVXHRNWbBiLpxFOS5kS/Lbo36sxutgYpUwDUav8Y59Lho/n+o3hRl6Qi0yURw63NKSnUA== X-Received: by 2002:ae9:d8c4:: with SMTP id u187mr22189707qkf.354.1587483959666; Tue, 21 Apr 2020 08:45:59 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.95.18.252]) by smtp.gmail.com with ESMTPSA id b13sm1977835qka.20.2020.04.21.08.45.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 08:45:58 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id CD5B7301985; Tue, 21 Apr 2020 11:45:53 -0400 (-04) Date: Tue, 21 Apr 2020 11:45:53 -0400 From: Alvaro Herrera To: Justin Pryzby Cc: Amit Langote , Tom Lane , PostgreSQL Hackers Subject: Re: DETACH PARTITION and FOR EACH ROW triggers on partitioned tables Message-ID: <20200421154553.GA21155@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200420230406.GA27302@alvherre.pgsql> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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