pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: pgsql-committers@postgresql.org
Subject: pgsql: Remove superuser checks in pgstattuple
Date: Fri, 30 Sep 2016 02:13:43 +0000
Message-ID: <E1bpnKZ-0002qJ-CL@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Remove superuser checks in pgstattuple

Now that we track initial privileges on extension objects and changes to
those permissions, we can drop the superuser() checks from the various
functions which are part of the pgstattuple extension and rely on the
GRANT system to control access to those functions.

Since a pg_upgrade will preserve the version of the extension which
existed prior to the upgrade, we can't simply modify the existing
functions but instead need to create new functions which remove the
checks and update the SQL-level functions to use the new functions
(and to REVOKE EXECUTE rights on those functions from PUBLIC).

Thanks to Tom and Andres for adding support for extensions to follow
update paths (see: 40b449a), allowing this patch to be much smaller
since no new base version script needed to be included.

Approach suggested by Noah.

Reviewed by Michael Paquier.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/fd321a1dfd64d30bf1652ea6b39b654304f68ae4

Modified Files
--------------
contrib/pgstattuple/Makefile                  |   7 +-
contrib/pgstattuple/pgstatapprox.c            |  39 ++++++--
contrib/pgstattuple/pgstatindex.c             | 122 ++++++++++++++++++++++++--
contrib/pgstattuple/pgstattuple--1.4--1.5.sql | 111 +++++++++++++++++++++++
contrib/pgstattuple/pgstattuple.c             |  41 +++++++++
contrib/pgstattuple/pgstattuple.control       |   2 +-
doc/src/sgml/pgstattuple.sgml                 |   8 ++
7 files changed, 315 insertions(+), 15 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1bpnKZ-0002qJ-CL@gemulon.postgresql.org>
Permalink:  ../E1bpnKZ-0002qJ-CL@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1bpnKZ-0002qJ-CL@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: sfrost@snowman.net
  Subject: Re: pgsql: Remove superuser checks in pgstattuple
  In-Reply-To: <E1bpnKZ-0002qJ-CL@gemulon.postgresql.org>
  References: <E1bpnKZ-0002qJ-CL@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox