Re: "20.16. Customized Options" – cannot be set by `ALTER SYSTEM`

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: "20.16. Customized Options" – cannot be set by `ALTER SYSTEM`
Дата
Msg-id 19600510deacf21b05a2c76bc3bde8d1283c77e3.camel@cybertec.at
обсуждение исходный текст
Ответ на Re: "20.16. Customized Options" – cannot be set by `ALTER SYSTEM`  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: "20.16. Customized Options" – cannot be set by `ALTER SYSTEM`  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-docs
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



В списке pgsql-docs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: "20.16. Customized Options" – cannot be set by `ALTER SYSTEM`
Следующее
От: PG Doc comments form
Дата:
Сообщение: No explanation of other options