Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fd1QN-0003rc-41 for pgsql-bugs@arkaria.postgresql.org; Tue, 10 Jul 2018 22:47:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fd1QL-0004S7-BY for pgsql-bugs@arkaria.postgresql.org; Tue, 10 Jul 2018 22:47:57 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fd1QL-0004S0-1x for pgsql-bugs@lists.postgresql.org; Tue, 10 Jul 2018 22:47:57 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fd1QE-0000X1-5O for pgsql-bugs@lists.postgresql.org; Tue, 10 Jul 2018 22:47:55 +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 w6AMlm3U004684; Tue, 10 Jul 2018 18:47:48 -0400 From: Tom Lane To: pgsqlpl@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15251: query plan affected by grant select on partition In-reply-to: <152967245839.1266.6939666809369185595@wrigleys.postgresql.org> References: <152967245839.1266.6939666809369185595@wrigleys.postgresql.org> Comments: In-reply-to =?utf-8?q?PG_Bug_reporting_form?= message dated "Fri, 22 Jun 2018 13:00:58 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4682.1531262868.1@sss.pgh.pa.us> Date: Tue, 10 Jul 2018 18:47:48 -0400 Message-ID: <4683.1531262868@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk =?utf-8?q?PG_Bug_reporting_form?= writes: > Plan of SELECT query on a parent table, which actually get data from an > inherited table (partition) depends on grants for a partition. > - When current_user is missing a grant to SELECT from a partition then > planner incorrectly decides to use BitmapAnd on two GIN Indexes (see "Bad > plan" below). Yeah, I concur this is a bug; two bugs really. See analysis at https://www.postgresql.org/message-id/3876.1531261875@sss.pgh.pa.us It's not clear at this point whether it'll be practical to fix in released branches, but we'll try to do something about it going forward. regards, tom lane