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 1q7y9K-0004xC-0E for pgsql-hackers@arkaria.postgresql.org; Sat, 10 Jun 2023 12:56:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q7y9H-0005Nu-5v for pgsql-hackers@arkaria.postgresql.org; Sat, 10 Jun 2023 12:56:55 +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 1q7y9G-0005Nl-SX for pgsql-hackers@lists.postgresql.org; Sat, 10 Jun 2023 12:56:54 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q7y9E-001G1t-1e for pgsql-hackers@postgresql.org; Sat, 10 Jun 2023 12:56:53 +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 35ACul73625520; Sat, 10 Jun 2023 08:56:47 -0400 From: Tom Lane To: David Steele cc: Amit Langote , Pg Hackers Subject: Re: Views no longer in rangeTabls? In-reply-to: References: <3953179e-9540-e5d1-a743-4bef368785b0@pgmasters.net> <462cd5de-3ade-989b-0798-7e1cab562991@pgmasters.net> <470644.1686327286@sss.pgh.pa.us> Comments: In-reply-to David Steele message dated "Sat, 10 Jun 2023 10:30:29 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <625518.1686401807.1@sss.pgh.pa.us> Date: Sat, 10 Jun 2023 08:56:47 -0400 Message-ID: <625519.1686401807@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Steele writes: > On 6/10/23 09:57, Amit Langote wrote: >> I too have been thinking that setting relkind might be a good idea, even >> if only as a crosscheck that only view relations can look like that in >> the range table. > +1. Even better if we can do it for PG16. Well, if we're gonna do it we should do it for v16, rather than change the data structure twice. It wouldn't be hard exactly: /* * Clear fields that should not be set in a subquery RTE. Note that we * leave the relid, rellockmode, and perminfoindex fields set, so that the * view relation can be appropriately locked before execution and its * permissions checked. */ - rte->relkind = 0; rte->tablesample = NULL; rte->inh = false; /* must not be set for a subquery */ plus adjustment of that comment and probably also the comment for struct RangeTblEntry. regards, tom lane