Re: Redirecting query's output to a textfile? - Mailing list pgsql-general

From P.J. \"Josh\" Rovero
Subject Re: Redirecting query's output to a textfile?
Date
Msg-id 3C6D47AD.6000402@sonalysts.com
Whole thread Raw
In response to Re: Redirecting query's output to a textfile?  ("Thalis A. Kalfigopoulos" <thalis@cs.pitt.edu>)
List pgsql-general
for a single command, \g.  Example

select * from employees \g '/home/dbadmin/employees.tab'

Note that there isn't a semicolon at the end.  '\g' takes
care of that.  '\g' will also let you pipe the table output
to other commands........

Thalis A. Kalfigopoulos wrote:
> Depends on how you place the query? I assume you are asking about the psql client, so before the query just do:
> \o output.txt
>


--
P. J. "Josh" Rovero                                 Sonalysts, Inc.
Email: rovero@sonalysts.com    www.sonalysts.com    215 Parkway North
Work: (860)326-3671 or 442-4355                     Waterford CT 06385
***********************************************************************


pgsql-general by date:

Previous
From: david blood
Date:
Subject: current connections and queries
Next
From: Tom Lane
Date:
Subject: Re: current connections and queries