On fös, 2008-07-25 at 10:20 -0700, Sushma Sagaram wrote:
> My requirement is
> 1) to write a query in a file, read the input from that file, run in
> postgresql and write the output(query results) into a file. I'm not
> able to use combination of \i and \o
see psql --help
in particular the opti
On 9:50 am 07/30/08 "Ian Lea" <[EMAIL PROTECTED]> wrote:
> $ psql -whatever < test.sql > test.log
Also
psql -f > test.log
Almost the same as above..
> > =>\i test.sql \o test
That would be wrong.
Say you had test.sql
select * from mytable;
You can change test.sql to:
\o test.log
select * fro
If you are on unix just run
$ psql -whatever < test.sql > test.log
Don't know about Windows.
--
Ian.
On Fri, Jul 25, 2008 at 6:20 PM, Sushma Sagaram <[EMAIL PROTECTED]> wrote:
> My requirement is
> 1) to write a query in a file, read the input from that file, run in
> postgresql and write the
My requirement is
1) to write a query in a file, read the input from that file, run in
postgresql and write the output(query results) into a file. I'm not able to
use combination of \i and \o
Let' say I have file test.sql and in test.sql I write
select * from abc;
Now I need to read the query from