From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: 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 19:37:46 +0200
Message-ID: <19600510deacf21b05a2c76bc3bde8d1283c77e3.camel@cybertec.at> (raw)
In-Reply-To: <2307198.1697473749@sss.pgh.pa.us>
References: <169746329791.169914.16613647309012285391@wrigleys.postgresql.org>
<2307198.1697473749@sss.pgh.pa.us>
On Mon, 2023-10-16 at 12:29 -0400, Tom Lane wrote:
> I do see an issue here:
>
> regression=# ALTER SYSTEM SET foo.bar TO 'baz';
> ERROR: unrecognized configuration parameter "foo.bar"
> regression=# SET foo.bar TO 'baz';
> SET
> regression=# ALTER SYSTEM SET foo.bar TO 'baz';
> ALTER SYSTEM
>
> and now we have
>
> $ cat $PGDATA/postgresql.auto.conf
> # Do not edit this file manually!
> # It will be overwritten by the ALTER SYSTEM command.
> foo.bar = 'baz'
>
> 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.
Yours,
Laurenz Albe
[1]: https://postgr.es/m/CAFj8pRDY%2Bm9OOxfO10R7J0PAkCCauM-TweaTrdsrsLGMb1VbEQ%40mail.gmail.com
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: laurenz.albe@cybertec.at, tgl@sss.pgh.pa.us, gavinpanella@gmail.com, pgsql-docs@lists.postgresql.org
Subject: Re: "20.16. Customized Options" – cannot be set by `ALTER SYSTEM`
In-Reply-To: <19600510deacf21b05a2c76bc3bde8d1283c77e3.camel@cybertec.at>
* 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