Memory unit GUC range checks - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Memory unit GUC range checks
Date
Msg-id 1bfe7f4a-7e22-aa6e-7b37-f4d222ed2d67@iki.fi
Whole thread Raw
Responses Re: Memory unit GUC range checks  (Heikki Linnakangas <hlinnaka@iki.fi>)
Re: Memory unit GUC range checks  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
List pgsql-hackers
Hi,

I played around with the GUC memory units, specifically to test the new 
GUC_UNIT_BYTES flag (commit 6e7baa32):

$ postmaster -c track_activity_query_size=1024kB
FATAL:  1048576 is outside the valid range for parameter 
"track_activity_query_size" (100 .. 102400)

$ postmaster -c track_activity_query_size=1024MB
FATAL:  1073741824 is outside the valid range for parameter 
"track_activity_query_size" (100 .. 102400)

$ postmaster -c track_activity_query_size=1024GB
FATAL:  invalid value for parameter "track_activity_query_size": "1024GB"
HINT:  Value exceeds integer range.

$ 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 first two look OK, but the last two cases seem a bit weird. With 
1024 GB, it would be nice to print the valid range, like in the first 
two cases.

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.

- Heikki


pgsql-hackers by date:

Previous
From: Stas Kelvich
Date:
Subject: Re: Global snapshots
Next
From: Heikki Linnakangas
Date:
Subject: Re: Memory unit GUC range checks