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 1icdsc-0003L5-Lv for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Dec 2019 23:16:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1icdsa-0002Ob-SB for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Dec 2019 23:16:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1icdsa-0002Lr-HW for pgsql-hackers@lists.postgresql.org; Wed, 04 Dec 2019 23:16:20 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1icdsY-0004Zp-0u for pgsql-hackers@postgresql.org; Wed, 04 Dec 2019 23:16:20 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id xB4NGEZA006376; Wed, 4 Dec 2019 18:16:14 -0500 From: Tom Lane To: Peter Eisentraut cc: pgsql-hackers Subject: Re: about allow_system_table_mods and SET STATISTICS In-reply-to: References: Comments: In-reply-to Peter Eisentraut message dated "Wed, 04 Dec 2019 23:56:34 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <6374.1575501374.1@sss.pgh.pa.us> Date: Wed, 04 Dec 2019 18:16:14 -0500 Message-ID: <6375.1575501374@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Peter Eisentraut 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