That would depend on the client you're using. psql can do it either
directly (using \o) or by piping its output: psql -c "select * from
mytable;" mydb > out.txt
If you're using a programming library, I think you're on your own.
Adam Ruth
On Feb 8, 2004, at 10:28 AM, Russ Schneider wrote:
> Is there an easy way to pipe a select statement's output to a file?
>
> --
> [ Russ Schneider (a.k.a. Sugapablo) ]
> [ http://www.sugapablo.com <--music ]
> [ http://www.sugapablo.net <--personal ]
> [ sugapablo@12jabber.com <--jabber IM ]
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>