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 1l8RQL-00014L-0n for pgsql-bugs@arkaria.postgresql.org; Sat, 06 Feb 2021 17:31:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l8RQJ-0006kH-9v for pgsql-bugs@arkaria.postgresql.org; Sat, 06 Feb 2021 17:31:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l8RQJ-0006kA-3O for pgsql-bugs@lists.postgresql.org; Sat, 06 Feb 2021 17:31:07 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l8RQG-0000NZ-L8 for pgsql-bugs@lists.postgresql.org; Sat, 06 Feb 2021 17:31:06 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 116HV1Eo192155; Sat, 6 Feb 2021 12:31:01 -0500 From: Tom Lane To: Michael Paquier cc: todoubaba@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16856: Crash when add "_RETURN" rule on child table In-reply-to: <191747.1612632025@sss.pgh.pa.us> References: <16856-0363e05c6e1612fd@postgresql.org> <191747.1612632025@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Sat, 06 Feb 2021 12:20:25 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <192153.1612632661.1@sss.pgh.pa.us> Date: Sat, 06 Feb 2021 12:31:01 -0500 Message-ID: <192154.1612632661@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wrote: > So my take is that this is an oversight in the CREATE RULE logic > that allows converting a table to a view: if it has inheritance > parents or children we must disallow doing that. Come to think of it, applying ON INSERT/UPDATE/DELETE rules to inheritance tree members is a bit problematic too. If you do "UPDATE parent SET ..." then any ON UPDATE rules on the child table are ignored (since the rewriter considers only "parent"). This probably doesn't lead to any system malfunctions, but users might find it surprising. I bet we don't document that adequately. regards, tom lane