pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathandbossart@gmail.com>
To: mert@futo.org
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18964: `ALTER DATABASE ... RESET ...` fails to reset extension parameters that no longer exist
Date: Fri, 20 Jun 2025 14:53:43 -0500
Message-ID: <aFW8R6Qlgtbp7TOk@nathan> (raw)
In-Reply-To: <18964-ba09dea8c98fccd6@postgresql.org>
References: <18964-ba09dea8c98fccd6@postgresql.org>

Thanks for the report.

On Fri, Jun 20, 2025 at 12:24:20PM +0000, PG Bug reporting form wrote:
> My project uses PostgreSQL (default 14, but later versions are supported as
> well) with an extension where one of its parameters was removed in a later
> version. I had applied a non-default value for this parameter using `ALTER
> DATABASE immich SET vchordrq.prewarm_dim = '512,640,768,1024,1152,1536';`.
> After upgrading the extension to a version that no longer includes this
> parameter, admins reported that each connection emitted the following
> warning:
> ```
> 2025-06-18 23:32:46.765 CEST [49] WARNING:  invalid configuration parameter
> name "vchordrq.prewarm_dim"
> 2025-06-18 23:32:46.765 CEST [49] DETAIL:  "vchordrq" is a reserved prefix.
> ```
> 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.',
>   file: 'guc.c',
>   line: '1153',
>   routine: 'assignable_custom_variable_name'
> }
> ```
>
> [...]
>
> 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.  IIUC we'd need to
teach validate_option_array_item() to treat unknown custom parameters like
they're known (for calls from GUCArrayDelete()).

On the extension side, another option could be to leave the parameter
defined as a placeholder so that Postgres knows about it.

-- 
nathan





view thread (14+ messages)  latest in thread

Message-ID: <aFW8R6Qlgtbp7TOk@nathan>
Permalink:  ../aFW8R6Qlgtbp7TOk@nathan/
Also on:    postgresql.org/message-id/aFW8R6Qlgtbp7TOk@nathan

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: nathandbossart@gmail.com, 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: <aFW8R6Qlgtbp7TOk@nathan>

* 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