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 1ikcux-0001Fu-0r for pgsql-bugs@arkaria.postgresql.org; Thu, 26 Dec 2019 23:51:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ikcuv-00087e-R3 for pgsql-bugs@arkaria.postgresql.org; Thu, 26 Dec 2019 23:51:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ikcuv-00087X-JE for pgsql-bugs@lists.postgresql.org; Thu, 26 Dec 2019 23:51:45 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ikcun-0001vy-RJ for pgsql-bugs@lists.postgresql.org; Thu, 26 Dec 2019 23:51:44 +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 xBQNpYMo009486; Thu, 26 Dec 2019 18:51:34 -0500 From: Tom Lane To: Tomas Vondra cc: Zhihong Zhang , Jeff Janes , pgsql-bugs Subject: Re: Indexing on JSONB field not working In-reply-to: <20191226234124.wuarzcbdq5z5msiy@development> References: <20191220223005.f6w4ff4kdbgtanpz@development> <83E6A3F7-B1B4-4AD6-905A-BE11D244D35A@gmail.com> <4910.1577386715@sss.pgh.pa.us> <0A83C661-EDBB-43C8-9CBB-FB1E321A15CB@gmail.com> <12042.1577393358@sss.pgh.pa.us> <20191226234124.wuarzcbdq5z5msiy@development> Comments: In-reply-to Tomas Vondra message dated "Fri, 27 Dec 2019 00:41:24 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <9484.1577404294.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 26 Dec 2019 18:51:34 -0500 Message-ID: <9485.1577404294@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Tomas Vondra writes: > On Thu, Dec 26, 2019 at 05:25:22PM -0500, Zhihong Zhang wrote: >> I am not superuser. Let me see how I can get access to the superuser on= RDS. > You can't - that's the point of am environment managed by someone else. > Perhaps you could inspect the data directly in pg_statistic, not through > the pg_stats view. But I haven't tried if that works on RDS. He definitely shouldn't be able to do that, if not superuser. However, after experimenting a bit it seems like pg_stats does work for indexes as long as you are the owner of the index's table, which probably explains why it took so long for anybody to notice the problem. Maybe the OP is trying to look at the stats as a non-owner that's just been GRANT'ed table access? regards, tom lane