Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iucLD-0003pp-TO for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Jan 2020 13:16:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iucKE-0005IA-6z for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Jan 2020 13:15:10 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iucKD-0005I3-Ql for pgsql-hackers@lists.postgresql.org; Thu, 23 Jan 2020 13:15:09 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iucK0-0002np-LH for pgsql-hackers@postgresql.org; Thu, 23 Jan 2020 13:15:08 +0000 Received: from hnk.local (sp183-74-206-123.msb.spmode.ne.jp [183.74.206.123]) by oss.nttdata.com (Postfix) with ESMTPSA id A80A2605FC; Thu, 23 Jan 2020 22:14:49 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.101.5 at oss.nttdata.com Subject: Re: table partitioning and access privileges To: Amit Langote , Fujii Masao Cc: Tom Lane , PostgreSQL-development References: <6218.1577388354@sss.pgh.pa.us> From: Fujii Masao Message-ID: <3546b691-b744-12c9-fd2f-7dc31c3c030e@oss.nttdata.com> Date: Thu, 23 Jan 2020 22:14:48 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020/01/22 16:54, Amit Langote wrote: > Fujii-san, > > Thanks for taking a look. > > On Fri, Jan 10, 2020 at 10:29 AM Fujii Masao wrote: >> On Tue, Jan 7, 2020 at 5:15 PM Amit Langote wrote: >>> I tend to agree that TRUNCATE's permission model for inheritance >>> should be consistent with that for the other commands. How about the >>> attached patch toward that end? >> >> Thanks for the patch! >> >> The patch basically looks good to me. >> >> +GRANT SELECT (f1, fz), UPDATE (fz) ON atestc TO regress_priv_user2; >> +REVOKE TRUNCATE ON atestc FROM regress_priv_user2; >> >> These seem not to be necessary for the test. > > You're right. Removed in the attached updated patch. Thanks for updating the patch! Barring any objection, I will commit this fix and backport it to all supported versions. >> BTW, I found that LOCK TABLE on the parent table checks the permission >> of its child tables. This also needs to be fixed (as a separate patch)? > > Commit ac33c7e2c13 and a past discussion ([1], [2], resp.) appear to > disagree with that position, but I would like to agree with you > because the behavior you suggest would be consistent with other > commands. So, I'm attaching a patch for that too, although it would > be better to hear more opinions before accepting it. Yes. I'd like to hear more opinion about this. But since the document explains "Inherited queries perform access permission checks on the parent table only." in ddl.sgml, that also seems a bug to fix... Regards, -- Fujii Masao NTT DATA CORPORATION Advanced Platform Technology Group Research and Development Headquarters