Rewrite pg_size_pretty() to avoid compiler bug.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: fd2e2d09aa1d5ba198e09e6d936ff1bba7f62895
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2011-04-29T05:45:58Z
Releases: 9.1.0
Rewrite pg_size_pretty() to avoid compiler bug.

Convert it to use successive shifts right instead of increasing a divisor.
This is probably a tad more efficient than the original coding, and it's
nicer-looking than the previous patch because we don't need a special case
to avoid overflow in the last branch.  But the real reason to do it is to
avoid a Solaris compiler bug, as per results from buildfarm member moa.

Files

PathChange+/−
src/backend/utils/adt/dbsize.c modified +13 −19