Re: [PATCH] Cleanup of GUC units code - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: [PATCH] Cleanup of GUC units code
Date
Msg-id 48C900ED.3010902@gmx.net
Whole thread Raw
In response to Re: [PATCH] Cleanup of GUC units code  ("Robert Haas" <robertmhaas@gmail.com>)
Responses Re: [PATCH] Cleanup of GUC units code  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [PATCH] Cleanup of GUC units code  ("Robert Haas" <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas wrote:
>>> A good start might be to always OUTPUT memory parameters using the
>>> same base unit.
>> SHOW gives output that matches what you input.
> 
> Not for me it doesn't.
> 
> portal=# show temp_buffers;
>  temp_buffers
> --------------
>  1024
> (1 row)
> 
> portal=# set temp_buffers = '16MB';
> SET
> portal=# show temp_buffers;
>  temp_buffers
> --------------
>  2048
> (1 row)

temp_buffers is actually special-cased in the code because
   /*    * We show the GUC var until local buffers have been initialized, and    * NLocBuffer afterwards.    */

It is not clear to me right now why that is a good idea.  But it is only 
this one paramter.

The actual logic that SHOW uses in the general case is to reformat the 
value with the largest unit that allows for an integer value to be 
presented.  So this is neither your nor Greg's idea, but I think it 
gives useful behavior in practice.



pgsql-hackers by date:

Previous
From: Gregory Stark
Date:
Subject: Re: Transaction Snapshots and Hot Standby
Next
From: Tom Lane
Date:
Subject: Re: Postgresql coding conventions