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

From Pavel Stehule
Subject custom function for converting human readable sizes to bytes
Date
Msg-id CAFj8pRD-tGoDKnxdYgECzA4On01_uRqPrwF-8LdkSE-6bDHp0w@mail.gmail.com
Whole thread Raw
Responses Re: custom function for converting human readable sizes to bytes  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
List pgsql-hackers
Hi

I have to write some filters, and filtering by size is "unfriendly" due calculation in bytes.

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');


Ideas, comments?

Regards

Pavel
 

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: CreateFunction Statement
Next
From: Emre Hasegeli
Date:
Subject: Re: new full text search configurations