[GENERAL] How do I pipe output from query to a file in PostgreSQL?

2009-10-26 Thread Penrod, John
In oracle: SPOOL filename.txt Select * from customer; SPOOL OFF Results are piped to filename.txt How do I do this from the psql command line? John J. Penrod, OCP Oracle/EnterpriseDB Database Administrator St. Jude Children's Research

Re: [GENERAL] How do I pipe output from query to a file in PostgreSQL?

2009-10-26 Thread Kevin Kempter
On Monday 26 October 2009 12:03:13 Penrod, John wrote: In oracle: SPOOL filename.txt Select * from customer; SPOOL OFF Results are piped to filename.txt How do I do this from the psql command line? John J. Penrod, OCP Oracle/EnterpriseDB Database Administrator St. Jude

Re: [GENERAL] How do I pipe output from query to a file in PostgreSQL?

2009-10-26 Thread Raymond O'Donnell
On 26/10/2009 18:03, Penrod, John wrote: In oracle: SPOOL filename.txt Select * from customer; SPOOL OFF Results are piped to filename.txt How do I do this from the psql command line? \g filename will execute the query and send the result to filename. Ray. -- Raymond O'Donnell