Re: Redirecting query's output to a textfile?

From: "P(dot)J(dot) \"Josh\" Rovero" <rovero(at)sonalysts(dot)com>
To: "Thalis A(dot) Kalfigopoulos" <thalis(at)cs(dot)pitt(dot)edu>
Cc: Peter Peltonen <peter(dot)peltonen(at)fivetec(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Redirecting query's output to a textfile?
Date: 2002-02-15 17:38:53
Message-ID: 3C6D47AD.6000402@sonalysts.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)sonalysts(dot)com www.sonalysts.com 215 Parkway North
Work: (860)326-3671 or 442-4355 Waterford CT 06385
***********************************************************************

In response to

Browse pgsql-general by date

  From Date Subject
Next Message virka prasetia 2002-02-15 17:58:17 object db in postgreSQL
Previous Message david blood 2002-02-15 17:27:34 current connections and queries