If you use psql and your query is in a file, try this:
$psql <dbname>
<dbname># \o <filename> (puts the output of the next query in a file)
<dbname># \i <queryfile> (reads and executes the query from the file)
<dbname> \q (quit psql)
Peter Peltonen wrote:
> A basic question:
>
> How in PostgreSQL do I redirect the output of an SQL query to a textfile?
>
>
Hope this helps...
_________________________
Herb Blacker
Database Administrator
ReCare, Inc.
(512) 791-4340
herbblacker(at)isgenesis(dot)com