Re: Why BgWriterDelay is fixed? - Mailing list pgsql-general

From Jeff Janes
Subject Re: Why BgWriterDelay is fixed?
Date
Msg-id CAMkU=1z66t9oV9OBb2D1NYxW355SYgr0Q3Qp-VXhVYZGqW923A@mail.gmail.com
Whole thread Raw
In response to Why BgWriterDelay is fixed?  (高健 <luckyjackgao@gmail.com>)
Responses Re: Why BgWriterDelay is fixed?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Mon, Oct 29, 2012 at 12:17 AM, 高健 <luckyjackgao@gmail.com> wrote:
> In src/backend/postmaster/bgwriter.c , I can find the following source
> code(PostgreSQL9.2):
>
>
> /*
>  * GUC parameters
>  */
> int BgWriterDelay = 200;

The value hard coded into the C code is the starting value, or
default.  It is not a constant.

Indeed, I don't think that value is even used.  I think that upon
start-up, that value gets set to the default listed in the guc.c file
(which is also 200), and so the value listed in the bgwriter.c file is
merely a mnemonic to remind people editing the file what the default
value is.


> But according to the fixed code of  BgWriterDelay = 200, even when I update
> bgwriter_delay in postgresql.conf to a different value(eg 300ms),
> how can it ovewrite the fixed  200ms in bgwriter.c ?

Doing so is the job of the "grand unified configuration" machinery, in
src/backend/utils/misc/guc.c



Cheers,

Jeff


pgsql-general by date:

Previous
From: Chris Angelico
Date:
Subject: Re: How to print application_name in log_line_prefix (using %a)?
Next
From: Tom Lane
Date:
Subject: Re: How to print application_name in log_line_prefix (using %a)?