pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: about allow_system_table_mods and SET STATISTICS
Date: Wed, 4 Dec 2019 23:56:34 +0100
Message-ID: <cc8d2648-a0ec-7a86-13e5-db473484e19e@2ndquadrant.com> (raw)

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.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachments:

0001-Remove-comment-about-SET-STATISTICS-on-system-tables.patch (text/plain, 1.5K) download From 203571a0402face9feb92a058d8423317501545e Mon Sep 17 00:00:00 2001 From: Peter Eisentraut <peter@eisentraut.org> Date: Wed, 4 Dec 2019 23:46:00 +0100 Subject: [PATCH] Remove comment about SET STATISTICS on system tables It was once possible to do ALTER TABLE ... SET STATISTICS on system tables without allow_sytem_table_mods. This was changed apparently by accident between PostgreSQL 9.1 and 9.2, but a code comment still claimed this was possible. Remove that comment. (Maybe someone wants to revive that functionality, but not right now.) --- src/backend/commands/tablecmds.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 5440eb9015..55b9b63336 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -6707,10 +6707,8 @@ static void ATPrepSetStatistics(Relation rel, const char *colName, int16 colNum, Node *newValue, LOCKMODE lockmode) { /* - * We do our own permission checking because (a) we want to allow SET - * STATISTICS on indexes (for expressional index columns), and (b) we want - * to allow SET STATISTICS on system catalogs without requiring - * allowSystemTableMods to be turned on. + * We do our own permission checking because we want to allow SET + * STATISTICS on indexes (for expressional index columns). */ if (rel->rd_rel->relkind != RELKIND_RELATION && rel->rd_rel->relkind != RELKIND_MATVIEW && -- 2.24.0

view thread (5+ messages)  latest in thread

Message-ID: <cc8d2648-a0ec-7a86-13e5-db473484e19e@2ndquadrant.com>
Permalink:  ../cc8d2648-a0ec-7a86-13e5-db473484e19e@2ndquadrant.com/
Also on:    postgresql.org/message-id/cc8d2648-a0ec-7a86-13e5-db473484e19e@2ndquadrant.com

 ·  · 

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: peter.eisentraut@2ndquadrant.com
  Subject: Re: about allow_system_table_mods and SET STATISTICS
  In-Reply-To: <cc8d2648-a0ec-7a86-13e5-db473484e19e@2ndquadrant.com>
  References: <cc8d2648-a0ec-7a86-13e5-db473484e19e@2ndquadrant.com>

* 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