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 1riG6a-00G29i-RA for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Mar 2024 15:56:25 +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 1riG6Y-006NWy-UR for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Mar 2024 15:56:23 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1riG6X-006NWq-Um for pgsql-hackers@lists.postgresql.org; Thu, 07 Mar 2024 15:56:23 +0000 Received: from wfout8-smtp.messagingengine.com ([64.147.123.151]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1riG6T-003Kp4-FS for pgsql-hackers@postgresql.org; Thu, 07 Mar 2024 15:56:21 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.west.internal (Postfix) with ESMTP id 604D41C0009D; Thu, 7 Mar 2024 10:56:16 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 07 Mar 2024 10:56:16 -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=1709826975; x=1709913375; bh=gD0EhkEkErpVa6AKoP90wZ2FyKX1DX7Y WFHmd1nmfJ8=; b=MRNi7jo+6RUo2+2DoGLKIJt31VRBuiMRxlelHMzAPtf2WEQO 7uMx+dWQW2cIw5jEQO1GDFX7XLBb97ZZY+Gr1tHgWK/785aND3P8Dk5uutIWxKL7 oSvQELqShyYFIYZ3VV03D1E2vPS7Xu9A1tgMSXeK+YlDmebKZC3DmOuY4w0MKzrt ukc9HPV3Kf7N7porUttpKPn66sXTD7ITdpqlqwjG4iyZqPkmlQoNTs4HIV6pb2D6 2uxSgmb3YzTK/t+AVC1DscChrJrILzYRChsIC3ee/aKT0tz8KD9am0lKPwJXVcC0 5vg7UsGh1ZoARBeNw09g5hhTdRBdhKlbyN/kMQ== 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=1709826975; x= 1709913375; bh=gD0EhkEkErpVa6AKoP90wZ2FyKX1DX7YWFHmd1nmfJ8=; b=H 7feb1gD8UPI1NpkZjL5spTxCV4Dx5N8Hd1wmETlmAfFzwGMvIGN9UUxLLgJEk5jf MaRMUs2TuazmFRUDFfeyg7/91K7v81GE4kJjZJJZKdp18zUYbW9jmnoiYh4QcTmL WaXX/6+Xfy9ByhsO3QQ45B2NdltZVTbFQPqJguF+817YwXv4NGfiJVIasUKyUQoZ WbpyYnfFZ3uc+TLgx8Ztd2DEYIiCHt3fE2dq9heAgcH4WgOfRNiXLlKU8nlXi2Es IpXJwt8WHXPGrYqWID7QffOfofCi31g6Il/Zly3asVHJHvA5KkkfCiZ0QwRq+njE +7yBZDFDWD5h8Uz7HxNCg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrieefgdekvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuhffvvehfjggtgfesthekredttddvjeenucfhrhhomheprfgvthgv rhcugfhishgvnhhtrhgruhhtuceophgvthgvrhesvghishgvnhhtrhgruhhtrdhorhhgqe enucggtffrrghtthgvrhhnpeejgedvgffgfffguddtheegvefhgeeulefgleetteevtedv veetledvfefhveefgfenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgnecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhes vghishgvnhhtrhgruhhtrdhorhhg X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 7 Mar 2024 10:56:14 -0500 (EST) Message-ID: Date: Thu, 7 Mar 2024 16:56:13 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: RangeTblEntry.inh vs. RTE_SUBQUERY Content-Language: en-US From: Peter Eisentraut To: pgsql-hackers Cc: Dean Rasheed , Tom Lane 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> <09a4b507-1c38-4eca-81bb-296245175893@eisentraut.org> In-Reply-To: <09a4b507-1c38-4eca-81bb-296245175893@eisentraut.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 03.03.24 11:02, Peter Eisentraut wrote: > 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. I have committed the patches for this discussion. Related discussion will continue at https://www.postgresql.org/message-id/flat/4b27fc50-8cd6-46f5-ab20-88dbaadca645@eisentraut.org / https://commitfest.postgresql.org/47/4697/ .