On 2019-Apr-28, Peter Geoghegan wrote:
> Commit ab0dfc961b6 used a "long" variable within _bt_load() to count
> the number of tuples entered into a B-Tree index as it is built. This
> will not work as expected on Windows, even on 64-bit Windows, because
> "long" is only 32-bits wide. It's far from impossible that you'd have
> ~2 billion index tuples when building a new index.
Agreed. Here's a patch. I see downthread that you also discovered the
same mistake in _h_indexbuild by grepping for "long"; I got to it by
examining callers of pgstat_progress_update_param and
pgstat_progress_update_multi_param. I didn't find any other mistakes of
the same ilk. Some codesites use "double" instead of "int64", but those
are not broken.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services