Re: custom function for converting human readable sizes to bytes

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: custom function for converting human readable sizes to bytes
Дата
Msg-id CAFj8pRAcJ+4xoxkRyZJNJ7dPbwtb42EPaogPH5BfZWoxx44Ysg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: custom function for converting human readable sizes to bytes  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: custom function for converting human readable sizes to bytes  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Hi

new update:

1. unit searching is case insensitive

2. initial support for binary byte prefixes - KiB, MiB, ..  (IEC standard), change behave for SI units

Second point is much more complex then it is looking - if pg_size_bytes should be consistent with pg_size_pretty.

The current pg_size_pretty and transformations in guc.c are based on JEDEC standard. Using this standard for GUC has sense - using it for object sizes is probably unhappy.

I tried to fix (and enhance) pg_size_pretty - now reports correct units, and via second parameter it allows to specify base: 2 (binary, IEC  - default) or 10 (SI).

I think it is good to have it. These standards are generic and wide used, but should to be pretty explained in documentation if we will use JEDEC for configuration. Probably better to leave JEDEC and prefer SI and IEC.

Plan B is fix Postgres on JEDEC only - it is trivial, simple - but it can look like archaic in next years.

Comments, notices?

Regards

Pavel





Вложения

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

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: [PATCH] Equivalence Class Filters
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Re: BUG #13685: Archiving while idle every archive_timeout with wal_level hot_standby