Ah, you're right. Thanks Hannu, that's a good solution.

Hannu Krosing wrote:
On Fri, 2010-04-02 at 16:28 -0400, Beaver, John E wrote:
...

  
I know that the query used here could have been a COPY statement, which I assume would
 be better-behaved, but I'm more concerned about the case in which the query is more complex.
    

COPY can copy out results of a SELECT query as well.

  

-- 
John E. Beaver
Bioinformatics Developer
Harvard Medical School