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 1ikYlk-0000O5-Pg for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Dec 2019 19:26:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ikYlj-0005Uj-Ff for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Dec 2019 19:25:59 +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 1ikYlj-0005UX-3Y for pgsql-hackers@lists.postgresql.org; Thu, 26 Dec 2019 19:25:59 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ikYlg-0002k6-SF for pgsql-hackers@postgresql.org; Thu, 26 Dec 2019 19:25:57 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id xBQJPsFt006219; Thu, 26 Dec 2019 14:25:54 -0500 From: Tom Lane To: Fujii Masao cc: PostgreSQL-development Subject: Re: table partitioning and access privileges In-reply-to: References: Comments: In-reply-to Fujii Masao message dated "Thu, 26 Dec 2019 15:37:52 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <6217.1577388354.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 26 Dec 2019 14:25:54 -0500 Message-ID: <6218.1577388354@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Fujii Masao writes: > My customer reported me that the queries through a partitioned table > ignore each partition's SELECT, INSERT, UPDATE, and DELETE privileges, > on the other hand, only TRUNCATE privilege specified for each partition > is applied. I'm not sure if this behavior is expected or not. But anyway > is it better to document that? For example, > Access privileges may be defined and removed separately for each par= tition. > But note that queries through a partitioned table ignore each partit= ion's > SELECT, INSERT, UPDATE and DELETE privileges, and apply only TRUNCAT= E one. I believe it's intentional that we only check access privileges on the table explicitly named in the query. So I'd say SELECT etc are doing the right thing, and if TRUNCATE isn't in step with them that's a bug to fix, not something to document. regards, tom lane