Re: Help: How to store query output in a file !!!

From: "Len Morgan" <len-morgan(at)crcom(dot)net>
To: <selkovjr(at)mcs(dot)anl(dot)gov>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Help: How to store query output in a file !!!
Date: 2000-06-14 12:09:38
Message-ID: 002801bfd5f9$6ad9e0e0$0908a8c0@H233.bstx.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)mcs(dot)anl(dot)gov <selkovjr(at)mcs(dot)anl(dot)gov>
To: NEERAJ BANSAL <nbansal1(at)email(dot)mot(dot)com>
Cc: pgsql-general(at)postgresql(dot)org <pgsql-general(at)postgresql(dot)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(at)hotmail(dot)com
>
>

Browse pgsql-general by date

  From Date Subject
Next Message Andrea Aime 2000-06-14 13:00:54 Lock record
Previous Message Barnes 2000-06-14 10:56:26 RE: PostgreSQL and multiple database access