• Heikki Linnakangas's avatar
    Accept "B" in all memory-unit GUCs, and improve error messages. · b06d8e58
    Heikki Linnakangas authored
    Commit 6e7baa32 added support for "B" unit, for specifying config options
    in bytes. However, it was only accepted in GUC_UNIT_BYTE settings,
    wal_segment_size and track_activity_query_size, and not e.g. in work_mem.
    This patch makes it consistent, so that "B" accepted in all the same
    contexts where "kB", "MB", and so forth are accepted.
    
    Add "B" to the list of accepted units in the error hint, along with "kB",
    "MB", etc.
    
    Add an entry in the conversion table for "TB" to "B" conversion. A terabyte
    is out of range for any GUC_UNIT_BYTE option, so you always get an "out of
    range" error with that, but without it, you get a confusing error message
    that claims that "TB" is not an accepted unit, with a hint that nevertheless
    lists "TB" as an accepted unit.
    
    Reviewed-by: Alexander Korotkov, Andres Freund
    Discussion: https://www.postgresql.org/message-id/1bfe7f4a-7e22-aa6e-7b37-f4d222ed2d67@iki.fi
    b06d8e58
guc.c 275 KB