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