pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: gavinpanella@gmail.com
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: "20.16. Customized Options" – cannot be set by `ALTER SYSTEM`
Date: Mon, 16 Oct 2023 16:21:09 -0400
Message-ID: <2508784.1697487669@sss.pgh.pa.us> (raw)
In-Reply-To: <19600510deacf21b05a2c76bc3bde8d1283c77e3.camel@cybertec.at>
References: <169746329791.169914.16613647309012285391@wrigleys.postgresql.org>
	<2307198.1697473749@sss.pgh.pa.us>
	<19600510deacf21b05a2c76bc3bde8d1283c77e3.camel@cybertec.at>

Laurenz Albe <laurenz.albe@cybertec.at> writes:
> On Mon, 2023-10-16 at 12:29 -0400, Tom Lane wrote:
>> So that feels like a bug: we should not allow ALTER SYSTEM to execute
>> against a placeholder GUC definition, because the placeholder can't
>> tell us whether the value is valid.  I wonder though if forbidding
>> this would break any legitimate usage patterns.

> I feel the same.  However, the lack of any "variables" in SQL (as proposed
> in [1]) leads a lot of people to abuse placeholder parameters as variables
> to hold application state.  I am sure that that is where this complaint
> comes from.  We maintain that doing so is not a valid use case, but that claim
> sounds increasingly like a grammarian declaring that sentences should not
> end with a preposition, when everybody does it all the time.

Yeah, and we have been slowly removing the issues that made us not want
to recommend using them like that.

Anyway, I realized that I was wrong to claim that we need ALTER SYSTEM
to defend us against bogus values of extension parameters in the config
file.  Checking is an important thing to do for core parameters, but
a faulty extension parameter doesn't stop the system from booting.
That's because we'll apply all the config file entries before we load
any extensions, even ones listed in shared_preload_libraries.  When
we do load an extension, if it doesn't like what it finds in a placeholder
then you get a WARNING and the parameter's default value is substituted.
So there's no risk of an unstartable system.

So maybe we should allow ALTER SYSTEM for unrecognized parameters,
as long as the parameter name is syntactically legit and you're a
superuser.

			regards, tom lane





view thread (5+ messages)  latest in thread

Message-ID: <2508784.1697487669@sss.pgh.pa.us>
Permalink:  ../2508784.1697487669@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2508784.1697487669@sss.pgh.pa.us

 · 

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-docs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, laurenz.albe@cybertec.at, gavinpanella@gmail.com, pgsql-docs@lists.postgresql.org
  Subject: Re: "20.16. Customized Options" – cannot be set by `ALTER SYSTEM`
  In-Reply-To: <2508784.1697487669@sss.pgh.pa.us>

* 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