"Jim C. Nasby" <jim@nasby.net> writes:
> Well, there's other ways to do what I'm thinking of that don't rely on
> getting a free memory number from the OS. For example, there could be a
> 'total_sort_mem' parameter that specifies the total amount of memory
> that can be used for all sorts on the entire machine.
How would you find out how many other sorts are going on (and how much
memory they're actually using)? And probably more to the point, what do
you do if you want to sort and the parameter's already exhausted?
regards, tom lane