pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: about allow_system_table_mods and SET STATISTICS
Date: Wed, 04 Dec 2019 18:16:14 -0500
Message-ID: <6375.1575501374@sss.pgh.pa.us> (raw)
In-Reply-To: <cc8d2648-a0ec-7a86-13e5-db473484e19e@2ndquadrant.com>
References: <cc8d2648-a0ec-7a86-13e5-db473484e19e@2ndquadrant.com>

Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> Until PostgreSQL 9.1, it was possible to run ALTER TABLE ... SET 
> STATISTICS without allow_system_table_mods.  In PostgreSQL 9.2 and 
> later, this no longer works.  This change was apparently accidental.  (I 
> gave up after a while trying to bisect it exactly, but probably 
> something related to 1489e2f26a4c0318938b3085f50976512f321d84.)
> (It didn't work on mapped relations, so it wasn't all roses.)

> A comment in ATPrepSetStatistics() still makes references to this being 
> possible.  I propose to remove this comment.
> There was some discussion about (re-)allowing this and some other 
> commands like this, but after the recent changes to make 
> allow_system_table_mods easier to use, I think this has less urgency, so 
> I'd rather get the comment correct in the meantime.

Seems reasonable.  The argument for making this an exception to
allow_system_table_mods was always more about expediency than logical
cleanliness.  After the recent changes I think it's okay to remove the
special case (especially since nobody has griped about it being broken).

However ... if we're not going to have that special case, couldn't
we get rid of the whole business of having a special permissions test?
What is it that ATSimplePermissions can't handle here?  The business
about requiring a colName certainly doesn't need to be done before the
ownership check (in fact, it could be left to execution, so we don't need
a prep function at all anymore).

			regards, tom lane





view thread (5+ messages)  latest in thread

Message-ID: <6375.1575501374@sss.pgh.pa.us>
Permalink:  ../6375.1575501374@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/6375.1575501374@sss.pgh.pa.us

 · 

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-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, peter.eisentraut@2ndquadrant.com
  Subject: Re: about allow_system_table_mods and SET STATISTICS
  In-Reply-To: <6375.1575501374@sss.pgh.pa.us>
  References: <cc8d2648-a0ec-7a86-13e5-db473484e19e@2ndquadrant.com> <6375.1575501374@sss.pgh.pa.us>

* 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