But I guess I ahvehave so much data, the above query is dying with the below error:
THisThis is after pointing my temporary space (pgsql_tmppgsql_tmp
directory) at a partition that gives it 20 GB of temp space. So my question is, how can I rewrite the above so tahtthat it does not use as much temp space? That is fine if it takes the query a really long time to run.