Re: custom function for converting human readable sizes to bytes

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: custom function for converting human readable sizes to bytes
Дата
Msg-id CAFj8pRBRzZDE3=o+s_x_LuB+62LEuZ8iJK59XumtuC=Beb61dw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: custom function for converting human readable sizes to bytes  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: custom function for converting human readable sizes to bytes
Re: custom function for converting human readable sizes to bytes
Список pgsql-hackers
Hi

2015-11-23 19:47 GMT+01:00 Alvaro Herrera <alvherre@2ndquadrant.com>:
Pavel Stehule wrote:

> so pg_size_bytes is good enough for everybody?

That seems good enough to me.

I would have it accept GiB and GB and have both transform to base 2, and
have an optional boolean flag whose non-default value turns the GB
interpretation into base 10, leaving the GiB interpretation unaffected.

attached proof concept based on parser "parse_int" from guc.c

It works well to 1TB what is enough for memory setting, but too low for proposed target.

There are two ways

1. enhance the "parse_int"

2. using independent implementation - there is some redundant code, but we can support duble insted int, and we can support some additional units.

Regards

Pavel


--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Вложения

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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: problem with msvc linker - cannot build orafce
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: problem with msvc linker - cannot build orafce