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 1l0XYT-00062U-09 for pgsql-hackers@arkaria.postgresql.org; Fri, 15 Jan 2021 22:26:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l0XYR-00036f-GW for pgsql-hackers@arkaria.postgresql.org; Fri, 15 Jan 2021 22:26:51 +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 1l0XYR-00036Y-9n for pgsql-hackers@lists.postgresql.org; Fri, 15 Jan 2021 22:26:51 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l0XYO-0005ZO-Lw for pgsql-hackers@lists.postgresql.org; Fri, 15 Jan 2021 22:26:50 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 2850A128D; Fri, 15 Jan 2021 17:26:46 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 15 Jan 2021 17:26:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=/0QZPNz15Pl29mtxA1L1CoxDj9chSDzrlagoCPA7MrI=; b=FybYSlaN drgNoLfBa2ZaCCh4SxjJjmHqlCc9PAunmBuhEEEJiT9AVH8BJcXbjo2Du9sBX391 sb/VTTkouhKNtKW8pnI4WYZcUlOuKwNBW8hk6DwL46A+k9IfhFjyuIgPz8F2hejW Si/Ki9HvFXVlAxUI3HOg02gTcc3zCy4TM0gFBwRVQkA3ab9S/h0SNew5XZMJVtZ9 YDT6AdT4Qav3U1plBImflZoghDlJZoRUnCN/iArXaf4T83sIYUcdlFTj5KOjj5dT uq1AU+TK3l21GlE+mS0B3FVE4IwkpgUX+wti2+gCi+9jIed6HLhg7kBTACeXRunW omytRSkd2Nhrgw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrtddvgddufeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggugfgjfgesthekredttderudenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepveejjeekjeejieevueduvdefffeihfffgfelhefgueeg jeehuddvfeekiefhffdtnecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghenuc fkphepudeltddrleehrdduledrudejjeenucevlhhushhtvghrufhiiigvpedtnecurfgr rhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorh hg X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.177]) by mail.messagingengine.com (Postfix) with ESMTPA id DFCE024005E; Fri, 15 Jan 2021 17:26:43 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 25E772A0FB5; Fri, 15 Jan 2021 19:26:41 -0300 (-03) Date: Fri, 15 Jan 2021 19:26:41 -0300 From: Alvaro Herrera To: Arne Roland Cc: Pg Hackers Subject: Re: Rename of triggers for partitioned tables Message-ID: <20210115222641.GA26284@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <62ebc64869794398bfe46844aaa6ba15@index.de> 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-Nov-27, Arne Roland wrote: > I got too annoyed at building queries for gexec all the time. So wrote > a patch to fix the issue that the rename of partitioned trigger > doesn't affect children. As you say, triggers on children don't necessarily have to have the same name as on parent; this already happens when the trigger is renamed in the child table but not on parent. In that situation the search on the child will fail, which will cause the whole thing to fail I think. We now have the column pg_trigger.tgparentid, and I think it would be better (more reliable) to search for the trigger in the child by the tgparentid column instead, rather than by name. Also, I think it would be good to have ALTER TRIGGER .. ON ONLY parent RENAME TO .. to avoid recursing to children. This seems mostly pointless, but since we've allowed changing the name of the trigger in children thus far, then we've implicitly made it supported to have triggers that are named differently. (And it's not entirely academic, since the trigger name determines firing order.) Alternatively to this last point, we could decide to disallow renaming of triggers on children (i.e. if trigger has tgparentid set, then renaming is disallowed). I don't have a problem with that, but it would have to be an explicit decision to take. I think you did not register the patch in commitfest, so I did that for you: https://commitfest.postgresql.org/32/2943/ Thanks! -- Álvaro Herrera Valdivia, Chile "¿Cómo puedes confiar en algo que pagas y que no ves, y no confiar en algo que te dan y te lo muestran?" (Germán Poo)