Re: Bruce Momjian 2016-07-30 <20160730181643.GD22405@momjian.us>
> I also just applied a doc patch that increases case and spacing
> consistency in the use of kB/MB/GB/TB.
Hi,
PostgreSQL uses the spaces inconsistently, though. pg_size_pretty uses spaces:
# select pg_size_pretty((2^20)::bigint);pg_size_pretty
────────────────1024 kB
SHOW does not:
# show work_mem;work_mem
──────────1MB
The SHOW output is formatted by _ShowOption() using 'INT64_FORMAT "%s"',
via convert_from_base_unit(). The latter has a comment attached...
/** Convert a value in some base unit to a human-friendly unit. The output* unit is chosen so that it's the greatest
unitthat can represent the value* without loss. For example, if the base unit is GUC_UNIT_KB, 1024 is* converted to 1
MB,but 1025 is represented as 1025 kB.*/
... where the spaces are present again.
General typesetting standard seems to be "1 MB", i.e. to include a
space between value and unit. (This would also be my preference.)
Opinions? (I'd opt to insert spaces in the docs now, and then see if
inserting a space in the SHOW output is acceptable for 10.0.)
Christoph