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 1ovGq7-0001x7-QE for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Nov 2022 11:44:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ovGq6-0005ol-7d for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Nov 2022 11:44:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ovGq5-0005oc-1m for pgsql-hackers@lists.postgresql.org; Wed, 16 Nov 2022 11:44:21 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ovGpw-0004Dy-KL for pgsql-hackers@lists.postgresql.org; Wed, 16 Nov 2022 11:44:20 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 8BDF15C018A; Wed, 16 Nov 2022 06:44:09 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 16 Nov 2022 06:44:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1668599049; x=1668685449; bh=8 9bGGasU/4E9zAyOP0URdjRCzh/EjedX6QgTBlLbb+0=; b=xEOBt8VigNctl69G7 +bk0DfjWBxk7cKweTqpxSZlOuaqqVy3a0yalJVZL5wqvuIRr/zgjJ7HMVm8ucJAu /IQeLstfG4p39RYvq1N30qszOn8/lzGxWsVuCxYnFic8zw/mla7863s+GiN3pNRP g9X1iViHW8zio5p75QLhN7JAM68J4nANq5IAv3NG8veS/HSkf0GvVkvlXWROzllp b2HzInx0bFlngVY8r2oPUMOtgjkChdDm3mQWApD4rFXNLP3yNdvigaaIye/lDNfW hTRWfwGQ7OB7D9Hv10NgLCfbwg2AWs0JxrJg5Rl/76c5ch6eXtPh1Sz1V9etwVzA jtLEw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrgeeigdefudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfggtggugfgjsehmkeerredttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpeetuddtgefhheeflefhteegjeelueetkedugeektdegkeet hefgjeeitdfhgfeutdenucffohhmrghinheptghirhhruhhsqdgtihdrtghomhdpvghnth gvrhhprhhishgvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm pehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 16 Nov 2022 06:44:06 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id BFBE139C; Wed, 16 Nov 2022 12:44:02 +0100 (CET) Date: Wed, 16 Nov 2022 12:44:02 +0100 From: Alvaro Herrera To: Amit Langote Cc: Ian Lawrence Barwick , Tom Lane , David Rowley , Greg Stark , Zhihong Yu , Julien Rouhaud , PostgreSQL Hackers Subject: Re: ExecRTCheckPerms() and many prunable partitions Message-ID: <20221116114402.merw5gdwkzlc35t4@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="3sqhherzatux5zde" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221110115801.qnsaci3viwlcpy42@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --3sqhherzatux5zde Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On 2022-Nov-10, Alvaro Herrera wrote: > I couldn't find any cross-check that > some perminfo element that we obtain for a rte does actually match the > relation we wanted to check. Maybe we could add a test in some central > place that perminfo->relid equals rte->relid? I hadn't looked hard enough. This is already in GetRTEPermissionInfo(). > A related point is that concatenating lists doesn't seem to worry about > not processing one element multiple times and ending up with bogus offsets. > I think the API of ConcatRTEPermissionInfoLists is a bit weird. Why not > have the function return the resulting list instead, just like > list_append? It is more verbose, but it seems easier to grok. Another point related to this. I noticed that everyplace we do ConcatRTEPermissionInfoLists, it is followed by list_append'ing the RT list themselves. This is strange. Maybe that's the wrong way to look at this, and instead we should have a function that does both things together: pass both rtables and rtepermlists and smash them all together. I attach your 0001 again with a bunch of other fixups (I don't include your 0002ff). I've pushed this to see the CI results, and so far it's looking good (hasn't finished yet though): https://cirrus-ci.com/build/5126818977021952 I'll have a look at 0002 now. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ --3sqhherzatux5zde Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v25-0001-Rework-query-relation-permission-checking.patch"