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 1pIX6k-0006rY-JY for pgsql-committers@arkaria.postgresql.org; Thu, 19 Jan 2023 15:45:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pIX6j-0003ko-HI for pgsql-committers@arkaria.postgresql.org; Thu, 19 Jan 2023 15:45:41 +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 1pIX6j-0003ke-AB for pgsql-committers@lists.postgresql.org; Thu, 19 Jan 2023 15:45:41 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pIX6g-0004an-RG for pgsql-committers@lists.postgresql.org; Thu, 19 Jan 2023 15:45:40 +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 30JFjYFQ4063401; Thu, 19 Jan 2023 10:45:35 -0500 From: Tom Lane To: Alvaro Herrera cc: pgsql-committers@lists.postgresql.org, Amit Langote Subject: Re: pgsql: Remove some dead code in selfuncs.c In-reply-to: References: Comments: In-reply-to Alvaro Herrera message dated "Thu, 19 Jan 2023 12:03:51 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4063399.1674143134.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 19 Jan 2023 10:45:34 -0500 Message-ID: <4063400.1674143134@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alvaro Herrera writes: > Remove some dead code in selfuncs.c > RelOptInfo.userid is the same for all relations in a given inheritance > tree, so the code in examine_variable() and example_simple_variable() > that repeats the ACL checks on the root parent rel instead of a given > leaf child relations need not recompute userid too. This change seems rather ill-advised. The premise is false: regression=3D# create user joe; CREATE ROLE regression=3D# \c - joe You are now connected to database "regression" as user "joe". regression=3D> create table joestable(f1 int) partition by range (f1); CREATE TABLE regression=3D> \c - postgres regression=3D# create table joeschild partition of joestable for values fr= om (1) to (10); CREATE TABLE regression=3D# select relname, relowner from pg_class where relname like '= joe%'; relname | relowner = -----------+---------- joeschild | 10 joestable | 39822 (2 rows) I didn't read the actual code, so perhaps it's okay, but not if it's doing what your commit message says. regards, tom lane