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 1hcQyL-0005bL-7n for pgsql-committers@arkaria.postgresql.org; Sun, 16 Jun 2019 08:57:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hcQyH-0008Fc-7f for pgsql-committers@arkaria.postgresql.org; Sun, 16 Jun 2019 08:57:05 +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 1hcQyG-0008FV-P4 for pgsql-committers@lists.postgresql.org; Sun, 16 Jun 2019 08:57:05 +0000 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hcQyD-0003u8-9e for pgsql-committers@lists.postgresql.org; Sun, 16 Jun 2019 08:57:03 +0000 Received: by mail-wm1-x344.google.com with SMTP id a15so6246455wmj.5 for ; Sun, 16 Jun 2019 01:57:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=LqMH+MtNKWgx4c94n7viig18a/+mgCryTZgFaLBtNe4=; b=vx/kt0I1gGY5/eyL8Ud0qxhpQi5TulSU2y+nPv/vU+h8UR4CmVrZ+QdWomtXsw2MEk MuakimuX526G8UbeG9yzyrd7PW4hyKLMnJe+pFkvGfWJminBCPg/hRKoTibtVQjUNXRV s8ym1VeeXccr7IT8Xx2Oi3T9uokoKtJ+x1Xs7gGrFXUDMl8W21TxHoD6CGYbVghiAZWI ql+MsEt5C3BzTY5icerwJwIEfcVDi1KmGT2VM9aApwzpN0kIrmyZk3I0PIQxHvbaEBXN 0z6SHLzyVAvnzlQgbPXeZ8vw1QfDnxeoTs2U7FLo3yhdO1SQQYnLyDu66VqWwXmdEcDl Igpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=LqMH+MtNKWgx4c94n7viig18a/+mgCryTZgFaLBtNe4=; b=C5YYwXxS06hpjsvlO6ku+55WjLmddmwC/+Q3E8VTzaiOrw4gXNF5rtkga4gcCbMHi4 Pyl75doqW6eBvrN1FXa+MVsdXPMPGb6OqcEkogQRblvO109HaDloDlXaKjWwI8tRZkJy 6J/V/myKxO+E7hhxrQuy0PNJm1uXSpy3/OwzdsUmcfNpZV4yR4iusNMUrA/SxeSrcF30 tAdX5wBqumegAGcn38ukxTqRXavjGH+Iqb9fbIrdwgBUL7oN8D4MK44rtuTnOjKjnMqy WXnX7lY7jbTQ+4mcDu6mH7r5ir70p2JDOSlMOzgovAgh3LwiTOls3FfPIq/7gB0Q6g4T xWiA== X-Gm-Message-State: APjAAAVh9+twXxTOQxIJq7cjj4d054JgEp2cCaqXM7Nm+ozzJZDNGIDD vD5qdtFyl9RHDM9I6mCZVvfhOg== X-Google-Smtp-Source: APXvYqzgd4un5Okdr+9iBgas8Jv7x6B/GL4ANBaE4yUI8H7frcHPrzZ6YNt0NX+IATuHTWMrR0pnPw== X-Received: by 2002:a1c:7f93:: with SMTP id a141mr14359160wmd.131.1560675418603; Sun, 16 Jun 2019 01:56:58 -0700 (PDT) Received: from localhost (ip-86-49-243-43.net.upcbroadband.cz. [86.49.243.43]) by smtp.gmail.com with ESMTPSA id c4sm3163684wrb.68.2019.06.16.01.56.52 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 16 Jun 2019 01:56:52 -0700 (PDT) Date: Sun, 16 Jun 2019 10:56:51 +0200 From: Tomas Vondra To: Dean Rasheed Cc: Tom Lane , Tomas Vondra , pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Rework the pg_statistic_ext catalog Message-ID: <20190616085651.d2hxuiqlojewed5j@development> References: <8833.1560647898@sss.pgh.pa.us> <20156.1560650744@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716-1444-295967 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sun, Jun 16, 2019 at 07:18:58AM +0100, Dean Rasheed wrote: >On Sun, 16 Jun 2019, 03:05 Tom Lane, wrote: > >> 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. >> >> > >Hang on. Isn't the real problem that we should be revoking public access >from pg_statistic_ext_data, not pg_statistic_ext? Normal users should still >be able to see the stats definitions in the catalog table, but not the >stats data, so I think pg_dump wouldn't need changing. > Yeah, that's pretty much why we split the catalog - to allow pg_dump to read the definitions, without exposing the stats too. I'll look into this and push a fix to unbreak the buildfarm (sorry about that). regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services