Re: custom function for converting human readable sizes to bytes
Jim Nasby <jim.nasby@bluetreble.com>
From: Jim Nasby <Jim.Nasby@BlueTreble.com>
To: Corey Huinker <corey.huinker@gmail.com>, Pavel Stehule
<pavel.stehule@gmail.com>
Cc: Guillaume Lelarge <guillaume@lelarge.info>, PostgreSQL Developers
<pgsql-hackers@postgresql.org>
Date: 2015-11-23T16:59:04Z
Lists: pgsql-hackers
On 11/23/15 3:11 AM, Corey Huinker wrote: > +1 to both pg_size_bytes() and ::bytesize. Both contribute to making the > statements more self-documenting. The function seems like overkill to me if we have the type. Just my opinion though. I'm thinking the type could just be called 'size' too (or prettysize?). No reason it has to be tied to bytes (in particular this would work for bits too). If we're going to add this, I suppose it should support the 'i prefixes' too (GiB, MiB, etc). -- Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX Experts in Analytics, Data Architecture and PostgreSQL Data in Trouble? Get it in Treble! http://BlueTreble.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