Re: custom function for converting human readable sizes to bytes
Vitaly Burovoy <vitaly.burovoy@gmail.com>
From: Vitaly Burovoy <vitaly.burovoy@gmail.com>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: "Shulgin, Oleksandr" <oleksandr.shulgin@zalando.de>,
Robert Haas <robertmhaas@gmail.com>,
Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>,
Alvaro Herrera <alvherre@2ndquadrant.com>,
Tom Lane <tgl@sss.pgh.pa.us>, Jim Nasby <Jim.Nasby@bluetreble.com>,
Corey Huinker <corey.huinker@gmail.com>,
Guillaume Lelarge <guillaume@lelarge.info>,
PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2016-01-26T12:48:07Z
Lists: pgsql-hackers
Hello, Pavel! That letter was not a complain against you. I'm sorry if it seems like that for you. It was an intermediate review with several points to be clear for _me_ from experienced hackers, mostly about a code design. 26.01.2016 07:05, Pavel Stehule пишет: >> pg_proc.h has changed, so the CATALOG_VERSION_NO must be also changed. > this is not a part of patch - only a commiter knows CATALOG_VERSION_NO > CATALOG_VERSION_NO is mentioned for a committer, it is not your fault. >> III. There is no support of 'bytes' unit, it seems such behavior got >> majority approval[2]. > > No, because I have to use the supported units by configuration. The configuration supports only three chars long units. Support for "bytes" was removed, when I removed proprietary unit table. > Point "III" is the only for the question "d". Also to collect any possible features from the thread in one place. >> V. The documentation lacks a note that the base of the "pg_size_bytes" >> is 1024 whereas the base of the "pg_size_pretty" is 1000. > > It isn't true, base for both are 1024. It was designed when special table was used for pg_size_bytes. But when we share same control table, then is wrong to use different table. The result can be optically different, but semantically same. > Oops, I was wrong about a base of pg_size_pretty. It was a morning after a hard night... > negative values is fully supported. You have mentioned it at least three times before. It is not my new requirement or a point to your fault, it is an argument for symmetry/asymmetry of the function. > support of "bytes" depends on support "bytes" unit by GUC. When "bytes" unit will be supported, then it can be used in pg_size_bytes immediately. By the way there can be a comparison for a special size unit before calling parse_memory_unit. > Regards > Pavel > >> [2]http://www.postgresql.org/message-id/CACACo5QW7fFsFfhKsTjtYcP4QF3Oh9zA14SC6Z3DXx2yssJjSw@mail.gmail.com
Commits
-
Add pg_size_bytes() to parse human-readable size strings.
- 53874c5228fe 9.6.0 landed
-
Refactor check_functional_grouping() to use get_primary_key_attnos().
- f144f73242ac 9.6.0 cited
-
Correct comment in GetConflictingVirtualXIDs()
- 1129c2b0ad27 9.6.0 cited
-
Make extract() do something more reasonable with infinite datetimes.
- 647d87c56ab6 9.6.0 cited
-
pg_size_pretty: Format negative values similar to positive ones.
- 8a1fab36aba7 9.6.0 cited
-
pg_size_pretty(numeric)
- 4a2d7ad76f5f 9.2.0 cited