Re: custom function for converting human readable sizes to bytes

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: custom function for converting human readable sizes to bytes
Дата
Msg-id CAFj8pRAxOLJfoOcDx1JeHo_TgaYnwMoRm6iqB-Q6-5MGCzbB8g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: custom function for converting human readable sizes to bytes  (Corey Huinker <corey.huinker@gmail.com>)
Ответы Re: custom function for converting human readable sizes to bytes
Список pgsql-hackers


2015-11-22 23:54 GMT+01:00 Corey Huinker <corey.huinker@gmail.com>:

What about pg_size_unpretty()?

I was going to suggest pg_size_ugly(), but unpretty does emphasize the inverse (rather than opposite) nature of the function.

"unpretty", "ugly" aren't good names

maybe pg_size_bytes or different approach

we can introduce data type - bytesize - default input/output is human readable text - and conversion to bigint is implicit

Some like

select .. where pg_table_size(oid) > bytesize '3.5GB'

and instead pg_size_pretty(pg_table_size(oid)) we can write pg_table_size(oid)::bytesize

Regards

Pavel

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andreas Karlsson
Дата:
Сообщение: Re: [PATCH] Reload SSL certificates on SIGHUP
Следующее
От: Praveen M
Дата:
Сообщение: Identify user requested queries