Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: Proposal for Allow postgresql.conf values to be changed via SQL [review])

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: Proposal for Allow postgresql.conf values to be changed via SQL [review])
Дата
Msg-id 000001ce882b$892f9010$9b8eb030$@kapila@huawei.com
обсуждение исходный текст
Ответ на Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: Proposal for Allow postgresql.conf values to be changed via SQL [review])  (Josh Berkus <josh@agliodbs.com>)
Список pgsql-hackers
On Tuesday, July 23, 2013 5:06 AM Josh Berkus wrote:
> All,
>
> Christophe just discovered something with include files which is going
> to cause issues with ALTER SYSTEM SET.
>
> So, take as a hypothetical that you use the default postgresql.conf
> file, which sets shared_buffers = 32MB.
>
> Instead of editing this file, you do ALTER SYSTEM SET shared_buffers =
> '1GB', which updates config/postgresql.auto.conf.
>
> Then you restart PostgreSQL.
>
> Everything is hunky-dory, until a later occasion where you *reload*
> postgresql.  Then postgres startup hits the first "shared_buffers=32MB"
> (in postgresql.conf), says "I can't change shared buffers on a reload",
> and aborts before ever getting to postgresql.auto.conf.

It doesn't abort after showing initial message "parameter %s cannot be changed without restart", rather it processes
allremaining parameters. 
We can even test it by setting 1 postmaster and 1 sighup variable, after reload, even though it log message for
postmastervariable, but it will set 
the sighup variable.

So in this the real problem is that there is some message in log which can create confusion, otherwise the behavior
willbe exactly what user wants as per Postgres specs. 

To avoid the message, following can be done:
1. We need to make sure that in function ProcessConfigFile before calling set_config_option(), list of parameters is
unique. a. it can be done while storing the elements in list as suggested by me in my yesterday's mail.
http://www.postgresql.org/message-id/004c01ce8761$b8a4ab20$29ee0160$@kapila@huawei.com b. after parsing all the config
files,make sure the list contain one entry for any variable      (giving priority to elements that come later) 
2. As this is just a confusing message issue, we can even update the docs to explain this behavior.


With Regards,
Amit Kapila.




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

Предыдущее
От: Andrew Gierth
Дата:
Сообщение: Re: Proposal/design feedback needed: WITHIN GROUP (sql standard ordered set aggregate functions)
Следующее
От: Amit Langote
Дата:
Сообщение: Re: maintenance_work_mem and CREATE INDEX time