Re: custom function for converting human readable sizes to bytes - Mailing list pgsql-hackers

From Robert Haas
Subject Re: custom function for converting human readable sizes to bytes
Date
Msg-id CA+TgmoYbNNG67hRC+7nWtFwBEQRMgPHVBYf0_RSKrvaydZkujw@mail.gmail.com
Whole thread Raw
In response to Re: custom function for converting human readable sizes to bytes  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
On Mon, Jan 4, 2016 at 3:48 PM, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
> Robert Haas wrote:
>
>> But you could also write SELECT relname FROM pg_class WHERE
>> pg_relation_size(oid) > 100 * 1024^3, which is actually fewer
>> characters.  Maybe pg_size_bytes('100 GB') is easier for some people
>> to remember than 100 * 1024^3, but I'm probably not one of those
>> people.
>
> Nah, that might work for geek types, but I doubt it's the preferred
> spelling for most people.  I think the proposal is quite reasonable.
>
> If we were only catering for people who can do 2^10 arithmetic off the
> top of their heads, we wouldn't have pg_size_pretty at all, would we?

Well, I don't know what 100 * 1024^3 is off the top of my head, but I
know that I can compute it by typing exactly that.  So I think one
direction is easier than the other.  However, IJWH.

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



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: custom function for converting human readable sizes to bytes
Next
From: Pavel Stehule
Date:
Subject: Re: ALTER TABLE behind-the-scenes effects' CONTEXT