Re: Memory unit GUC range checks

From: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Beena Emerson <memissemerson(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: Memory unit GUC range checks
Date: 2018-05-16 13:39:36
Message-ID: CAPpHfdswPwjoXM+A9KDb4QtdRMqenYRPCS5ud=wFnPjK3n6PoQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 16, 2018 at 3:49 PM, Heikki Linnakangas <hlinnaka(at)iki(dot)fi> wrote:

> On 16/05/18 15:19, Heikki Linnakangas wrote:
>
>> $ postmaster -c track_activity_query_size=1024TB
>> FATAL: invalid value for parameter "track_activity_query_size": "1024TB"
>> HINT: Valid units for this parameter are "kB", "MB", "GB", and "TB".
>>
>> ...
>>
>> The HINT in the last message seems wrong: the hint claims that "TB" is
>> accepted, yet "1024 TB" was not accepted. And shouldn't the hint also
>> mention "B", since we accept that now?
>>
>>
>> Testing a setting with GUC_UNIT_KB:
>>
>> $ postmaster -c work_mem=102400B
>> FATAL: invalid value for parameter "work_mem": "100000B"
>> HINT: Valid units for this parameter are "kB", "MB", "GB", and "TB".
>>
>> This time the hint is accurate, but why is "B" not accepted here? Seems
>> inconsistent.
>>
>
> Here's a pretty straightforward fix for these two issues. Any objections
> or better ideas?

This patch looks good for me.
But I would also like to see units in valid range message (as I wrote in
previous email).

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-05-16 13:44:32 Re: NaNs in numeric_power (was Re: Postgres 11 release notes)
Previous Message Alexander Korotkov 2018-05-16 13:35:14 Re: Memory unit GUC range checks