Re: ALTER SYSTEM SET command to change postgresql.conf parameters - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: ALTER SYSTEM SET command to change postgresql.conf parameters
Date
Msg-id CAHGQGwGKO3vAys1pCx1x_EcVTO13xiNhdVXUy55tK1YRmrTKsw@mail.gmail.com
Whole thread Raw
In response to Re: ALTER SYSTEM SET command to change postgresql.conf parameters  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: ALTER SYSTEM SET command to change postgresql.conf parameters
List pgsql-hackers
On Fri, Dec 20, 2013 at 2:35 AM, Fujii Masao <masao.fujii@gmail.com> wrote:
> On Thu, Dec 19, 2013 at 2:21 PM, Tatsuo Ishii <ishii@postgresql.org> wrote:
>>> I found that the psql tab-completion for ALTER SYSTEM SET has not been
>>> implemented yet.
>>> Attached patch does that. Barring any objections, I will commit this patch.
>>
>> Good catch!
>
> Committed.

I found the bug of ALTER SYSTEM SET patch. The procedure to reproduce
it is here.

$ psql
=# ALTER SYSTEM SET shared_buffers = '512MB';
ALTER SYSTEM
=# \q
$ pg_ctl -D data reload
server signaled
2013-12-22 18:24:13 JST LOG:  received SIGHUP, reloading configuration files
2013-12-22 18:24:13 JST LOG:  parameter "shared_buffers" cannot be
changed without restarting the server
2013-12-22 18:24:13 JST LOG:  configuration file "X??" contains
errors; unaffected changes were applied

The configuration file name in the last log message is broken. This problem was
introduced by the ALTER SYSTEM SET patch.

>    FreeConfigVariables(head);
> <snip>
>        else if (apply)
>            ereport(elevel,
>                    (errcode(ERRCODE_CONFIG_FILE_ERROR),
>                     errmsg("configuration file \"%s\" contains errors; unaffected changes were applied",
>                            ErrorConfFile)));

The cause of the problem is that, in ProcessConfigFile(), the log
message including
the 'ErrorConfFile' is emitted after 'head' is free'd even though
'ErrorConfFile' points
to one of entry of the 'head'.

Regards,

-- 
Fujii Masao



pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: ISN extension bug? (with patch)
Next
From: "MauMau"
Date:
Subject: Re: [bug fix] multibyte messages are displayed incorrectly on the client