postgresql/contrib/pgstattuple
Tom Lane af7d181298 Fix pgstatindex() to give consistent results for empty indexes.
For an empty index, the pgstatindex() function would compute 0.0/0.0 for
its avg_leaf_density and leaf_fragmentation outputs.  On machines that
follow the IEEE float arithmetic standard with any care, that results in
a NaN.  However, per report from Rushabh Lathia, Microsoft couldn't
manage to get this right, so you'd get a bizarre error on Windows.

Fix by forcing the results to be NaN explicitly, rather than relying on
the division operator to give that or the snprintf function to print it
correctly.  I have some doubts that this is really the most useful
definition, but it seems better to remain backward-compatible with
those platforms for which the behavior wasn't completely broken.

Back-patch to 8.2, since the code is like that in all current releases.
2011-08-24 23:50:10 -04:00
..
Makefile Convert contrib modules to use the extension facility. 2011-02-13 22:54:49 -05:00
pgstatindex.c Fix pgstatindex() to give consistent results for empty indexes. 2011-08-24 23:50:10 -04:00
pgstattuple--1.0.sql Avoid use of CREATE OR REPLACE FUNCTION in extension installation files. 2011-02-13 22:54:52 -05:00
pgstattuple--unpackaged--1.0.sql Convert contrib modules to use the extension facility. 2011-02-13 22:54:49 -05:00
pgstattuple.c Basic foreign table support. 2011-01-01 23:48:11 -05:00
pgstattuple.control Convert contrib modules to use the extension facility. 2011-02-13 22:54:49 -05:00