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

From Pavel Stehule
Subject Re: custom function for converting human readable sizes to bytes
Date
Msg-id CAFj8pRAnRpzFX_WDtcZhjByxj+j0QxrtM2qQRQrFVUXyKahFmw@mail.gmail.com
Whole thread Raw
In response to Re: custom function for converting human readable sizes to bytes  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Responses Re: custom function for converting human readable sizes to bytes  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
List pgsql-hackers


2015-11-22 18:30 GMT+01:00 Jim Nasby <Jim.Nasby@bluetreble.com>:
On 11/21/15 12:49 AM, Pavel Stehule wrote:

I propose inversion function to pg_size_pretty function - like
pg_human_size.

Usage:

SELECT * FROM pg_class
   WHERE pg_table_size(oid) > pg_human_size('2GB');

I'm not a big fan of the name, but +1 on the general idea.

I am for any other good name
 

Maybe pg_size_pretty(text)?

I understand to your idea, but it can be too strange - function and inversion function share same name.

What about pg_size(text), pg_size(value bigint, unit text) ?

Regards

Pavel
 
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com

pgsql-hackers by date:

Previous
From: Marko Tiikkaja
Date:
Subject: Re: count_nulls(VARIADIC "any")
Next
From: Marko Tiikkaja
Date:
Subject: Re: custom function for converting human readable sizes to bytes