postgresql/contrib/pgstattuple
Tom Lane 8a32c94658 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:20 -04:00
..
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:06 +02:00
Makefile Blank line Makefile cleanups. 2009-04-28 17:07:50 +00:00
pgstatindex.c Fix pgstatindex() to give consistent results for empty indexes. 2011-08-24 23:50:20 -04:00
pgstattuple.c Ensure that contrib/pgstattuple functions respond to cancel interrupts 2010-04-02 16:16:51 +00:00
pgstattuple.sql.in Adjust pgstatindex() to give correct answers for indexes larger than 2008-03-21 03:23:30 +00:00
uninstall_pgstattuple.sql Add CVS version labels to all install/uninstall scripts. 2007-11-13 04:24:29 +00:00