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 1rgihV-007bcc-4Q for pgsql-hackers@arkaria.postgresql.org; Sun, 03 Mar 2024 10:04:10 +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 1rgigU-000pII-Hi for pgsql-hackers@arkaria.postgresql.org; Sun, 03 Mar 2024 10:03:07 +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 1rgigS-000pIA-JD for pgsql-hackers@lists.postgresql.org; Sun, 03 Mar 2024 10:03:06 +0000 Received: from wfout2-smtp.messagingengine.com ([64.147.123.145]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rgigK-002XVU-PT for pgsql-hackers@postgresql.org; Sun, 03 Mar 2024 10:03:04 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailfout.west.internal (Postfix) with ESMTP id 4C1751C000A3; Sun, 3 Mar 2024 05:02:52 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Sun, 03 Mar 2024 05:02:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm3; t=1709460171; x=1709546571; bh=uSOmn8j32HD+wH14/PsfDfpf/sgPxD6b xA4DCezNPrg=; b=DFlEn27Hwq/h6E4pvL5koraK/U+oBtkvS74DQNsu9CUyAMtn GDXQOGay95BLl6pnVyHeuKdAQeqVCFSBCLW1IIvYWBUhn/6cUxgLKFTdUD5PMLOC tL9E01tvGKu1E0LTnMOQEkQIH14Z7ppkanWVBlvOCneDxlosxyZYRIlJSKLVKbj7 fol603cpVP5tbj1FTEd/dfaXbP2Ujdib2yAYolsAPvG5NHLieZu0b+hyGJRX/FkX Y6Tc5iJ+HrGp+ZxQCjdnKkKBUMHh2viYKilwNhuAlEXP8Dketbd6P7+qLRW1Luq+ cfDlhIROlGffOM0zTQfBWTqj5ORX62MW8n4ahg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1709460171; x= 1709546571; bh=uSOmn8j32HD+wH14/PsfDfpf/sgPxD6bxA4DCezNPrg=; b=T nMqBNPmCKq9gVDvt91i7X0RPBcuDrcFEj8nj/fqbKn3aOPkCmQ31mC6nRuIho6b4 CbvpB5JPbEhkB4Px9guTyZSYPiLCpseWW4RwExs2+XayS0q8+ekz7UF9oWrgCJhN q0/rQPGL1FCJTGPs4023B49MBUzVNG8h9tsyCv+HI3GXtVmXCvOaJjWD/ynV6tH+ BwFdfZ/5LUkHlaxuBqn5HfCo5bV35HpHO4Eh89hBWMLp5JROmQRArEu/gkT6jR0Q A6RNE/4LL0iIuN5FrWe6+zMT0lfK6jBcMnjG16SFtDbQjRHdu2OERV/4Wro7jL4G FnQV8YbOrLcgYtjKA855g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrheehgdduudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeenucfhrhhomheprfgvthgv rhcugfhishgvnhhtrhgruhhtuceophgvthgvrhesvghishgvnhhtrhgruhhtrdhorhhgqe enucggtffrrghtthgvrhhnpefgjedthfekfedtuefgieelheetleejgefhueeltdfhueet vdffudekfeejhfegheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehpvghtvghrsegvihhsvghnthhrrghuthdrohhrgh X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 3 Mar 2024 05:02:50 -0500 (EST) Message-ID: <09a4b507-1c38-4eca-81bb-296245175893@eisentraut.org> Date: Sun, 3 Mar 2024 11:02:48 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: RangeTblEntry.inh vs. RTE_SUBQUERY Content-Language: en-US To: Tom Lane Cc: Dean Rasheed , pgsql-hackers References: <6c1fbccc-85c8-40d3-b08b-4f47f2093711@eisentraut.org> <814829.1708701565@sss.pgh.pa.us> <54faad3d-d604-4ef6-9e78-b055861f54cd@eisentraut.org> <2718281.1709230491@sss.pgh.pa.us> From: Peter Eisentraut In-Reply-To: <2718281.1709230491@sss.pgh.pa.us> 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 On 29.02.24 19:14, Tom Lane wrote: > Peter Eisentraut writes: >> In nodes/parsenodes.h, it says both >> This *must* be false for RTEs other than RTE_RELATION entries. > > Well, that's true in the parser ... > >> and also puts it under >> Fields valid in all RTEs: >> which are both wrong on opposite ends of the spectrum. >> I think it would make more sense to group inh under "Fields valid for a >> plain relation RTE" and then explain the exception for subqueries, like >> it is done for several other fields. > > Dunno. The adjacent "lateral" field is also used for only selected > RTE kinds. The section is /* * Fields valid in all RTEs: */ Alias *alias; /* user-written alias clause, if any */ Alias *eref; /* expanded reference names */ bool lateral; /* subquery, function, or values is LATERAL? */ bool inh; /* inheritance requested? */ bool inFromCl; /* present in FROM clause? */ List *securityQuals; /* security barrier quals to apply, if any */ According to my testing, lateral is used for RTE_RELATION, RTE_SUBQUERY, RTE_FUNCTION, RTE_TABLEFUNC, RTE_VALUES, which is 5 out of 9 possible. So I think it might be okay to relabel that section (in actuality or mentally) as "valid in several/many/most RTEs". But I'm not sure what reason there would be for having inh there, which is better described as "valid for RTE_RELATION, but also borrowed by RTE_SUBQUERY", which is pretty much exactly what is the case for relid, relkind, etc.