Tom Lane writes:

> David Christensen <david.christen...@crunchydata.com> writes:
>> Enclosed is the patch to change the return type to numeric, as well as one 
>> for expanding units to
>> add PB and EB.
>
> Can we really get away with changing the return type?  That would
> by no stretch of the imagination be free; one could expect breakage
> of a few user views, for example.

Hmm, that's a good point, and we can't really make the return type polymorphic 
(being as there isn't
a source type of the given return value).

> Independently of that, I'm pretty much -1 on going further than PB.
> Even if the additional abbreviations you mention are actually recognized
> standards, I think not that many people are familiar with them, and such
> input is way more likely to be a typo than intended data.

If we do go ahead and restrict the expansion to just PB, the return value of 
pg_size_bytes()  would
still support up to 8192 PB before running into range limitations.  I assume 
it's not worth creating
a pg_size_bytes_numeric() with the full range of supported units, but that is 
presumably an option
as well.

Best,

David


Reply via email to