"Marc G. Fournier" <scrappy(at)postgresql(dot)org> writes:
> I thought we added something in 8.1 for doing this, but can't seem to find
> anything ... where it reports how much memory is/was needed to do the sort
> to the logs ...
trace_sort
regards, tom lane