on the command line
psql -c "select * from my_table" databasename username > textfile.dat
> -----Original Message-----
> From: pgsql-general-owner@postgresql.org
> [mailto:pgsql-general-owner@postgresql.org]On Behalf Of Ben C
> Sent: Sunday, June 23, 2002 7:28 PM
> To: pgsql-general@postgresql.org
> Subject: [GENERAL] Redirecting Output
>
>
> Hi there,
>
> I am hoping that someone can point me to the docs where I will find
> the answer to this problem ... all I am trying to do is redirect
> output from a select statement (from either an SQL or PL\pgsql
> function) to a text file ... seems simple enough ... however after
> reading as many docs/books that I can find I have not been able to
> find a solution ... is it possible?? If so would someone be kind
> enough to point me to some documentation re: this?
>
> thanks
>
> Ben
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>
>
>