Re: how to redirect output to a file

From: "Usama Dar" <munir(dot)usama(at)gmail(dot)com>
To: pc <chavanpriya(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: how to redirect output to a file
Date: 2007-12-06 13:19:55
Message-ID: ff0e67090712060519s5948a39ak479832ccfe8ff741@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Dec 5, 2007 9:19 AM, pc <chavanpriya(at)gmail(dot)com> wrote:

> Hi,
>
> How to redirect the output of an sql command to a file?
> Thanks in advance

if you are using psql

postgres=# \o ~/sql.out
postgres=# select * from foo;

the output will be directed to a file, when you need to stop doing it

postgres=# \o

>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>

--
Usama Munir Dar http://linkedin.com/in/usamadar
Consultant Architect
Cell:+92 321 5020666
Skype: usamadar

In response to

Browse pgsql-general by date

  From Date Subject
Next Message A. Kretschmer 2007-12-06 13:22:43 Re: how to redirect output to a file
Previous Message Ivan Sergio Borgonovo 2007-12-06 13:06:55 Re: simple update on boolean