Re: ALTER SYSTEM SET command to change postgresql.conf parameters

From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: amit(dot)kapila16(at)gmail(dot)com
Cc: haribabu(dot)kommi(at)huawei(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: ALTER SYSTEM SET command to change postgresql.conf parameters
Date: 2013-12-18 14:55:41
Message-ID: 20131218.235541.235834015040324654.t-ishii@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>> Is there any reason for the function returns int as it always returns
>> 0 or 1. Maybe returns bool is better?
>
> No, return type should be bool, I have changed the same in attached patch.

Confirmed.

>> 2) initdb.c
>>
>> + strcpy(tempautobuf, "# Do not edit this file manually! \n");
>> + autoconflines[0] = pg_strdup(tempautobuf);
>> + strcpy(tempautobuf, "# It will be overwritten by the ALTER SYSTEM command. \n");
>> + autoconflines[1] = pg_strdup(tempautobuf);
>>
>> Is there any reason to use "tempautobuf" here? I think we can simply change to this:
>>
>> + autoconflines[0] = pg_strdup("# Do not edit this file manually! \n");
>> + autoconflines[1] = pg_strdup("# It will be overwritten by the ALTER SYSTEM command. \n");
>
> You are right, I have changed code as per your suggestion.

Confirmed.

>> 3) initdb.c
>>
>> It seems the memory allocated for autoconflines[0] and
>> autoconflines[1] by pg_strdup is never freed.
>
> I think, it gets freed in writefile() in below code.

Oh, I see. Sorry for noise.

I have committed your patches. Thanks.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-12-18 15:03:19 Re: pg_rewarm status
Previous Message Heikki Linnakangas 2013-12-18 14:50:39 Re: GIN improvements part 1: additional information