Re: dumping query results to a csv - Mailing list pgsql-admin

From David Durham
Subject Re: dumping query results to a csv
Date
Msg-id 430F5DD1.5060203@vailsys.com
Whole thread Raw
In response to Re: dumping query results to a csv  (Adi Alurkar <adi@sf.net>)
List pgsql-admin
Adi Alurkar wrote:
> Greetings,
>
> There is no direct way to achieve what you want, the easiest hack is  to
> create a temp table with you query i.e.
>
> create table tmp_foo as select col1, col4, col7 from table1, table2
> where  ....;
> copy table tmp_foo to [stdout|<file_name>]
>
> HTH

I ended up using pgadmin3 -- which has a nice feature for writing the
contents of a query to file.

Of course, I'm still going to follow this subject and look at other more
scriptable ways of doing this.

Thanks,

Dave

pgsql-admin by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: What is syslog:duration reporting ... ?
Next
From: "Marcelo A. Costa"
Date:
Subject: Set pgAdminIII charset