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 1hcKYO-0007Is-HY for pgsql-committers@arkaria.postgresql.org; Sun, 16 Jun 2019 02:05:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hcKYM-0002tS-HL for pgsql-committers@arkaria.postgresql.org; Sun, 16 Jun 2019 02:05:54 +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 1hcKYM-0002so-9V for pgsql-committers@lists.postgresql.org; Sun, 16 Jun 2019 02:05:54 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hcKYF-0001Vk-MR; Sun, 16 Jun 2019 02:05:53 +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 x5G25iF4020157; Sat, 15 Jun 2019 22:05:44 -0400 From: Tom Lane To: Tomas Vondra cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Rework the pg_statistic_ext catalog In-reply-to: <8833.1560647898@sss.pgh.pa.us> References: <8833.1560647898@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Sat, 15 Jun 2019 21:18:18 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20155.1560650744.1@sss.pgh.pa.us> Date: Sat, 15 Jun 2019 22:05:44 -0400 Message-ID: <20156.1560650744@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wrote: > Tomas Vondra writes: >> Rework the pg_statistic_ext catalog > So ... not one of the buildfarm members that are running TAP tests > likes this. ... > I think probably what's happening is that pg_dump is still trying to dump > directly from the catalog, when what it needs to do now is dump from the > view, in case it's not running as superuser. I experimented with extracting the required data from the view, and there are at least two show-stopper problems: * The view doesn't expose pg_statistic_ext.oid, which pg_dump has to have for dependency tracking purposes. I think we could just add it though. Now that OIDs are ordinary columns it won't even look very odd. * Rather than just not exposing the critical data for stats you don't have privilege to read, the view doesn't expose anything at all. I do not think that's acceptable; it creates a significant hazard of data loss during pg_dump, for no very good reason. What we should be doing, IMO, is still showing all the rows but filling the data-value columns with nulls in rows where the caller can't access the underlying data. regards, tom lane