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

From Herb Blacker
Subject Re: Redirecting query's output to a textfile?
Date
Msg-id 3C6D5F1B.4000702@isgenesis.com
Whole thread Raw
In response to Redirecting query's output to a textfile?  (Peter Peltonen <peter.peltonen@fivetec.com>)
List pgsql-general
If you use psql and your query is in a file, try this:

$psql <dbname>

<dbname># \o <filename> (puts the output of the next query in a file)

<dbname># \i <queryfile> (reads and executes the query from the file)


<dbname> \q (quit psql)


Peter Peltonen wrote:

> A basic question:
>
> How in PostgreSQL do I redirect the output of an SQL query to a textfile?
>
>

Hope this helps...
_________________________
Herb Blacker
Database Administrator
ReCare, Inc.
(512) 791-4340
herbblacker@isgenesis.com


pgsql-general by date:

Previous
From: Holger Marzen
Date:
Subject: Re: Question: Who's Using Postgres
Next
From: Brian Hirt
Date:
Subject: Re: Question: Who's Using Postgres