PostgreSQL CREATE INDEX memory requirement
Through version 9.3, the indirection array used for sorting had to fit in a single 1GB memory allocation.  This created an artificial limit on the number of tuples which could be sorted in memory.  Once that limit was reached, it had to switch to a disk sort, even if there was memory left over.

This restriction was removed in version 9.4.