Re: about allow_system_table_mods and SET STATISTICS

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: about allow_system_table_mods and SET STATISTICS
Date: 2019-12-04 23:16:14
Message-ID: 6375.1575501374@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Smith, Peter 2019-12-05 00:51:18 RE: Proposal: Add more compile-time asserts to expose inconsistencies.
Previous Message Peter Eisentraut 2019-12-04 22:58:22 Re: Update minimum SSL version