Re: [BUGS] BUG #14244: wrong suffix for pg_size_pretty()

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Thomas Berger <Thomas(dot)Berger(at)1und1(dot)de>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [BUGS] BUG #14244: wrong suffix for pg_size_pretty()
Date: 2016-09-14 15:45:59
Message-ID: CA+TgmoYmCcOGzo5y3T7__A+EhbxD0hXfWAK8K-9zvFjkEOBfzA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Wed, Sep 14, 2016 at 5:22 AM, Thomas Berger <Thomas(dot)Berger(at)1und1(dot)de> wrote:
> Today, i found the time to read all the mails in this thread, and i think i have to explain, why we decided to open a bug for this behavior.
>
> Pn Tuesday, 23. August 2016, 13:30:29 Robert Haas wrote:
>> J. Random User: I'm having a problem!
>> Mailing List: Gee, how big are your tables?
>> J. Random User: Here's some pg_size_pretty output.
>> Mailing List: Gosh, we don't know what that means, what do you have
>> this obscure GUC set to?
>> J. Random User: Maybe I'll just give up on SQL and use MongoDB.
>
> In fact, we had just the other way around. One of our most critical databases had some extreme bloat.
> Some of our internal customers was very confused, about the sizes reported by the database.
> This confusion has led to wrong decisions. (And a long discussion about the choice of DBMS btw)
>
> I think there is a point missing in this whole discussion, or i just didn't see it:
>
> Yeah, the behavior of "kB" is defined in the "postgresql.conf" documentation.
> But no _user_ reads this. There is no link or hint in the documentation of "pg_size_pretty()" [1].

Interesting. I think that our documentation should only describe the
way we use unit suffixes in one central place, but other places (like
pg_size_pretty) could link to that central place.

I don't believe that there is any general unanimity among users or
developers about the question of which suffixes devote units
denominated in units of 2^10 bytes vs. 10^3 bytes. About once a year,
somebody makes an argument that we're doing it wrong, but the evidence
that I've seen is very mixed. So when people say that there is only
one right way to do this and we are not in compliance with that one
right way, I guess I just don't believe it. Not everybody likes the
way we do it, but I am fairly sure that if we change it, we'll make
some currently-unhappy people happy and some currently-happy people
unhappy. And the people who don't care but wanted to preserve
backward compatibility will all be in the latter camp.

However, that is not to say that the documentation couldn't be better.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2016-09-14 15:54:45 Re: [BUGS] BUG #14244: wrong suffix for pg_size_pretty()
Previous Message Thomas Berger 2016-09-14 09:22:22 Re: [BUGS] BUG #14244: wrong suffix for pg_size_pretty()

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-09-14 15:54:45 Re: [BUGS] BUG #14244: wrong suffix for pg_size_pretty()
Previous Message Robert Haas 2016-09-14 15:32:12 Re: palloc() too large on pg_buffercache with large shared_buffers