How to determine how much disk-space postgresql 9.1 requires as temp_space to run a query?
Knowing how much will be used is hard.  How much has been used, you there are logging options for that.

set log_temp_files=0;
set client_min_messages TO log;
select count(distinct x) from generate_series(1,10000000) x;



  LOG:  temporary file: path "base/pgsql_tmp/pgsql_tmp25126.2", size 120127488.
  
  LOG:  temporary file: path "base/pgsql_tmp/pgsql_tmp25126.1", size 140000000