Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uSiI7-00C5Qh-8W for pgsql-bugs@arkaria.postgresql.org; Fri, 20 Jun 2025 20:24:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uSiI2-004BT4-UJ for pgsql-bugs@arkaria.postgresql.org; Fri, 20 Jun 2025 20:24:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uSiI2-004BR6-Lh for pgsql-bugs@lists.postgresql.org; Fri, 20 Jun 2025 20:24:47 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uSiI1-003CkX-0T for pgsql-bugs@lists.postgresql.org; Fri, 20 Jun 2025 20:24:46 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 55KKOf9p2474669; Fri, 20 Jun 2025 16:24:41 -0400 From: Tom Lane To: Nathan Bossart cc: mert@futo.org, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18964: `ALTER DATABASE ... RESET ...` fails to reset extension parameters that no longer exist In-reply-to: References: <18964-ba09dea8c98fccd6@postgresql.org> Comments: In-reply-to Nathan Bossart message dated "Fri, 20 Jun 2025 14:53:43 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2474667.1750451081.1@sss.pgh.pa.us> Date: Fri, 20 Jun 2025 16:24:41 -0400 Message-ID: <2474668.1750451081@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Nathan Bossart writes: > On Fri, Jun 20, 2025 at 12:24:20PM +0000, PG Bug reporting form wrote: >> As a solution, I added a migration that removes the now-redundant parameter >> with `ALTER DATABASE immich RESET vchordrq.prewarm_dim;`. However, while >> this worked for our CI that uses Postgres 14 and for admins using 14, we >> began getting reports from admins using 15, 16 and 17 that the migration >> fails with the following error: >> ``` >> PostgresError: invalid configuration parameter name "vchordrq.prewarm_dim" >> { >> severity_local: 'ERROR', >> severity: 'ERROR', >> code: '42602', >> detail: '"vchordrq" is a reserved prefix.', >> >> It would be great if `RESET`ing the parameter still worked in this >> situation, even if `SET`ing it does not. > It seems like we could at least allow superusers and folks with existing > privileges on removed parameters to RESET in this case. The hazard we need to pay attention to here is someone removing a parameter setting that they shouldn't have had privilege to do. In particular, if a non-superuser can RESET a SUSET-or-above parameter, that's bad. In the case at hand, where the prefix is known but the parameter isn't, I think we could safely assume that the setting is either a mistake (probably installed while the extension wasn't loaded) or the described case of a parameter the extension no longer uses. Either way it seems safe to allow RESET with suitable privileges on the target DB and/or role. If the prefix is not known, then we're really flying blind. It looks like we assume the parameter might be SUSET and therefore allow both ALTER DB/ROLE SET and RESET only to superusers. I'm hesitant to relax that case. regards, tom lane