Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rdWdl-0062VX-3Z for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Feb 2024 14:35:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rdWdj-001XT8-MW for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Feb 2024 14:35:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rdWdj-001XT0-D8 for pgsql-hackers@lists.postgresql.org; Fri, 23 Feb 2024 14:35:03 +0000 Received: from wfhigh6-smtp.messagingengine.com ([64.147.123.157]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rdWdh-000X66-Do for pgsql-hackers@postgresql.org; Fri, 23 Feb 2024 14:35:03 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.west.internal (Postfix) with ESMTP id 0F8161800087 for ; Fri, 23 Feb 2024 09:34:58 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 23 Feb 2024 09:34:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:message-id:mime-version:reply-to :subject:subject:to:to; s=fm3; t=1708698898; x=1708785298; bh=/i nOLmgo76OeODp7VBCP2YAixZAqxnIiOkucoz/uqYY=; b=aW5oRIKgij+DVt1vcm /Zr51Gv+ksS+axYya6FBTuuE2hrk77ZB8P4spKoiab7OIDT7yLV6frmYzdSJbDEw ldwVDLdrMdkpOp+ERrK+ihcxQj3Ya2xJB0rWn938PFJUWrOaQty9+9mnt5vHxhXb egqMsUKwphV2xDUgn4QEh/bHO6ujaxH+7ukHPE9EjttzyGJitG5qgiSW6Qp4BdBs ZIHgwN16OzVUbIIshhNBEx9ZQwFOJBRwPQvb01p/HnJyI4+HI3xvL7OYD0Yts3e0 92w4dqOUq17n652u/yOhyh5lSiOTJ1kPYhiQEoVaZ1MjEdxZuMrsuIDSG0x6wNnp wdPQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1708698898; x=1708785298; bh=/inOLmgo76OeODp7VBCP2YAixZAq xnIiOkucoz/uqYY=; b=WztFPO1LYaqvSeTDUDvU8G/LujpaZ29awEtxCUtvYH/e al409fu4m2E2o4y3H4zN245LnzcGwtyEEF2Q/e05e/49YRouhAINN0ORmsY8luFy 0XJKHyFHzrvfqnM3tY0Zf0hrt0xLje1R9NV8mm1GFUc2hM9TfOhT7cI/V16gt/4M SEHjXGJnAkz+oum+wWkY8UcxUGWudEZE53xevwMRVoqk5Z3Jf04cnpz/VOn7fb3c yn08QoF7S5sw4R0pmChl0wNiXmwG4O0qnwP/o3M4i/4/ifAjYHY0bID9tbILQK4C eI+2HVtItobRfzLJHS6UfnbGld0y1mowKILs5r+Yhg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeeigdeihecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfhffuvfgtgfesthejredttd dvjeenucfhrhhomheprfgvthgvrhcugfhishgvnhhtrhgruhhtuceophgvthgvrhesvghi shgvnhhtrhgruhhtrdhorhhgqeenucggtffrrghtthgvrhhnpeffteevuddtfeeljeevke egfeetffeuueeggfefgeekvdduleevleehudffvdevheenucevlhhushhtvghrufhiiigv pedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrsegvihhsvghnthhrrghuth drohhrgh X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Fri, 23 Feb 2024 09:34:57 -0500 (EST) Message-ID: <6c1fbccc-85c8-40d3-b08b-4f47f2093711@eisentraut.org> Date: Fri, 23 Feb 2024 15:34:56 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US From: Peter Eisentraut Subject: RangeTblEntry.inh vs. RTE_SUBQUERY To: pgsql-hackers Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Various code comments say that the RangeTblEntry field inh may only be set for entries of kind RTE_RELATION. For example * inh is true for relation references that should be expanded to include * inheritance children, if the rel has any. This *must* be false for * RTEs other than RTE_RELATION entries. and various comments in other files. (Confusingly, it is also listed under "Fields valid in all RTEs:", but that definitely seems wrong.) I have been deploying some assertions to see if the claims in the RangeTblEntry comments are all correct, and I tripped over something. The function pull_up_simple_union_all() in prepjointree.c sets ->inh to true for RTE_SUBQUERY entries: /* * Mark the parent as an append relation. */ rte->inh = true; Whatever this is doing appears to be some undocumented magic. If I remove the line, then regression tests fail with plan differences, so it definitely seems to do something. Is this something we should explain the RangeTblEntry comments?