Re: pg_size_pretty, SHOW, and spaces - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: pg_size_pretty, SHOW, and spaces
Date
Msg-id 20160802165116.GC32575@momjian.us
Whole thread Raw
In response to Re: pg_size_pretty, SHOW, and spaces  (Christoph Berg <myon@debian.org>)
Responses Re: pg_size_pretty, SHOW, and spaces
List pgsql-hackers
On Tue, Aug  2, 2016 at 11:29:01AM +0200, Christoph Berg wrote:
> > The issue is that we output "10 bytes", not "10bytes", but for units we
> > use "977KB".  That seems inconsistent, but it is the normal policy
> > people use.  I think this is because "977KB" is really "977K bytes", but
> > we just append the "B" after the "K" for bevity.
>
> It's the other way round:
>
> https://en.wikipedia.org/wiki/International_System_of_Units#General_rules
>
> | The value of a quantity is written as a number followed by a space
> | (representing a multiplication sign) and a unit symbol; e.g., 2.21 kg
> [...]
>
> I'd opt to omit the space anywhere where the value is supposed to be
> fed back into the config (SHOW, --parameters), but use the "pretty"
> format with space everywhere otherwise (documentation, memory counts
> in explain output, pg_size_pretty() etc.)

Yes, that's a strong argument for using a space.  I have adjusted the
patch to use spaces in all reasonable places.  Patch attached, which I
have gzipped because it was 133 KB.  (Ah, see what I did there?)  :-)

I am thinking of leaving the 9.6 docs alone as I have already made them
consistent (no space) with minimal changes.  We can make it consistent
the other way in PG 10.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

+ As you are, so once was I. As I am, so you will be. +
+                     Ancient Roman grave inscription +

Attachment

pgsql-hackers by date:

Previous
From: Andrew Gierth
Date:
Subject: Re: Wanting to learn about pgsql design decision
Next
From: Peter Eisentraut
Date:
Subject: Re: parallel.c is not marked as test covered