Skip site navigation (1) Skip section navigation (2)

Re: Converting postgresql.conf parameters to kilobytes

From: Shridhar Daithankar <shridhar(at)frodo(dot)hserus(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Converting postgresql.conf parameters to kilobytes
Date: 2004-06-02 13:53:35
Message-ID: 200406021923.35360.shridhar@frodo.hserus.net (view raw or flat)
Thread:
Lists: pgsql-hackers
Hi,

Any updates/opinions? Should we convert assign hooks to perform actual 
assignment and custom validation instead of just custom validation? It is 
clear from README that it is for validation purposes only..

Or Shall i look for some place else to perform conversion?

Shridhar

On Tuesday 01 June 2004 18:01, Shridhar Daithankar wrote:
> On Tuesday 01 June 2004 14:12, Shridhar Daithankar wrote:
> > Actually I need to find out few more things about it. It is not as simple
> > as adding a assign_hook. When I tried to initdb with changes, it demanded
> > 64MB of shared buffers which I (now) think that somewhere NBuffers are
> > used before postgresql.conf is parsed. So 8192*8000=64MB. But this is
> > just guesswork. Haven't looked in it there.
>
> Found  it. Following is the code that is causing problem.
>
> guc.c:2998
> -----------
> 				if (conf->assign_hook)
> 					if (!(*conf->assign_hook) (newval, changeVal, source))
> 					{
> 						ereport(elevel,
> 								(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
> 								 errmsg("invalid value for parameter \"%s\": %d",
> 										name, newval)));
> 						return false;
> 					}
>
> 				if (changeVal || makeDefault)
> 				{
> 					if (changeVal)
> 					{
> 						*conf->variable = newval;
> 						conf->gen.source = source;
> 					}
> -----------
>
> So even if assign_hook is executed, the value of variable is overwritten in
> next step which nullifies any factoring/change in value done in assign
> hook.
>
> I find this as a convention at many other place at guc.c. Call assign_hook
> and the overwrite the value. So is assign_hook called only to validate the
> value? How do I modify the value of the variable without getting specific?
>
> I tried
>
> if (changeVal && !(conf->assign_hook))

In response to

Responses

pgsql-hackers by date

Next:From: Alvaro HerreraDate: 2004-06-02 14:03:15
Subject: Re: Nested transactions and tuple header info
Previous:From: Tom LaneDate: 2004-06-02 13:52:28
Subject: Re: Nested transactions and tuple header info

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group