Re: Help: How to store query output in a file !!! - Mailing list pgsql-general

From Len Morgan
Subject Re: Help: How to store query output in a file !!!
Date
Msg-id 002801bfd5f9$6ad9e0e0$0908a8c0@H233.bstx.cc
Whole thread Raw
In response to Help: How to store query output in a file !!!  (NEERAJ BANSAL <nbansal1@email.mot.com>)
List pgsql-general
From psql:

test => \o <ouput-file-name>
test => <Enter your query here>
test => \o

This will leave the results of your query in the file "output-file-name"

This IS covered in the documentation and from within psql with \h

len morgan

-----Original Message-----
From: selkovjr@mcs.anl.gov <selkovjr@mcs.anl.gov>
To: NEERAJ BANSAL <nbansal1@email.mot.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Date: Wednesday, June 14, 2000 2:46 AM
Subject: Re: [GENERAL] Help: How to store query output in a file !!!


>>
>> Does anyone knows how do you send query output to a file???
>
>Welcome to Unix(TM):
>
>psql <database> -c "select * from <table name>, etc." > <file name>
>
>See also:
>
>http://www.isu.edu/departments/comcom/unix/workshop/io.html
>
>or, type "unix tutorial" in any web search engine.
>
>--Gene
>
>> I tried following but it does not work:
>> select * from <table name> \o <file name> ;
>>
>> Please let me know if anyone knows!! Thanks in advance
>>
>> Neeraj
>> neeraj_b@hotmail.com
>
>


pgsql-general by date:

Previous
From: "Barnes"
Date:
Subject: RE: PostgreSQL and multiple database access
Next
From: "Andrea Aime"
Date:
Subject: Lock record