Re: Allow ALTER SYSTEM SET on unrecognized custom GUCs

2023-10-23 Thread Andrew Dunstan
On 2023-10-16 Mo 20:19, Tom Lane wrote: Currently we have this odd behavior (for a superuser): 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

Re: Allow ALTER SYSTEM SET on unrecognized custom GUCs

2023-10-19 Thread Andrey M. Borodin
> On 17 Oct 2023, at 05:19, Tom Lane wrote: > > In the original discussion about this [1], I initially leaned towards > "they should both fail", but I reconsidered: there doesn't seem to be > any harm in allowing ALTER SYSTEM SET to succeed for any custom GUC > name, as long as you're

Re: Allow ALTER SYSTEM SET on unrecognized custom GUCs

2023-10-19 Thread shihao zhong
Thanks for the answer. The code looks good to me. Thanks, Shihao On Thu, Oct 19, 2023 at 12:00 PM Tom Lane wrote: > shihao zhong writes: > > I do like the idea that we should keep the set and the altar system with > > the same behavior. But one thing I am worried about is the typo detected >

Re: Allow ALTER SYSTEM SET on unrecognized custom GUCs

2023-10-19 Thread Tom Lane
shihao zhong writes: > I do like the idea that we should keep the set and the altar system with > the same behavior. But one thing I am worried about is the typo detected > here because I usually make that type of mistake myself. I believe we > should have an extra log to explicitly tell the user

Re: Allow ALTER SYSTEM SET on unrecognized custom GUCs

2023-10-19 Thread shihao zhong
I do like the idea that we should keep the set and the altar system with the same behavior. But one thing I am worried about is the typo detected here because I usually make that type of mistake myself. I believe we should have an extra log to explicitly tell the user this is a `custom variable`

Re: Allow ALTER SYSTEM SET on unrecognized custom GUCs

2023-10-17 Thread Andrei Lepikhov
On 18/10/2023 12:15, Tom Lane wrote: Andrei Lepikhov writes: "SET foo.bar TO 'smth'" can immediately alter the placeholder's value. But what is the reason that "ALTER SYSTEM SET foo.bar TO 'smth'" doesn't do the same? Because it's not supposed to take effect until you issue a reload command

Re: Allow ALTER SYSTEM SET on unrecognized custom GUCs

2023-10-17 Thread Tom Lane
Andrei Lepikhov writes: > "SET foo.bar TO 'smth'" can immediately alter the placeholder's value. > But what is the reason that "ALTER SYSTEM SET foo.bar TO 'smth'" doesn't > do the same? Because it's not supposed to take effect until you issue a reload command (and maybe not even then,

Re: Allow ALTER SYSTEM SET on unrecognized custom GUCs

2023-10-17 Thread Andrei Lepikhov
On 17/10/2023 07:19, Tom Lane wrote: Currently we have this odd behavior (for a superuser): 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

Allow ALTER SYSTEM SET on unrecognized custom GUCs

2023-10-16 Thread Tom Lane
Currently we have this odd behavior (for a superuser): 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 That is, you can't ALTER SYSTEM SET a