Re: How do I pipe output from query to a file in PostgreSQL? - Mailing list pgsql-general

From Raymond O'Donnell
Subject Re: How do I pipe output from query to a file in PostgreSQL?
Date
Msg-id 4AE60F4E.4020402@iol.ie
Whole thread Raw
In response to How do I pipe output from query to a file in PostgreSQL?  ("Penrod, John" <John.Penrod@STJUDE.ORG>)
List pgsql-general
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 :: Galway :: Ireland
rod@iol.ie

pgsql-general by date:

Previous
From: Kevin Kempter
Date:
Subject: Re: How do I pipe output from query to a file in PostgreSQL?
Next
From: Thom Brown
Date:
Subject: Re: [ANNOUNCE] [pgeu-general] PGDay.EU 2009 - approaching fast!