Re: [ADMIN] dumping query results to a csv

2005-08-26 Thread David Durham
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|] HTH I ended up using pgadmin3 -

[ADMIN] dumping query results to a csv

2005-08-25 Thread David Durham
This is kind of a pg-admin newbie question, so apologies in advance. Anyway, I'd like to issue a command that dumps the results of a query to a txt file in comma delimited format. Does PostgreSQL ship with something to do this? I searched the web, but found what appeared to be non-free solut

Re: [ADMIN] dumping query results to a csv

2005-08-25 Thread Steve Crawford
On Thursday 25 August 2005 3:24 pm, David Durham wrote: > This is kind of a pg-admin newbie question, so apologies in > advance. > > Anyway, I'd like to issue a command that dumps the results of a > query to a txt file in comma delimited format. Does PostgreSQL > ship with something to do this? I

Re: [ADMIN] dumping query results to a csv

2005-08-25 Thread Jim C. Nasby
On Thu, Aug 25, 2005 at 03:48:54PM -0700, 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 t

Re: [ADMIN] dumping query results to a csv

2005-08-25 Thread Jeff Frost
Whoops, should have also mentioned that you want -P format=unaligned like so: psql -P format=unaligned -F ',' snort < David, You're probably looking for something like this from the psql man page: -F separator --field-separator separator Use separator as the field

Re: [ADMIN] dumping query results to a csv

2005-08-25 Thread Adi Alurkar
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|] HTH Adi Alurkar [EMAIL PROTECTED] On Aug 25, 2005,

Re: [ADMIN] dumping query results to a csv

2005-08-25 Thread Jeff Frost
David, You're probably looking for something like this from the psql man page: -F separator --field-separator separator Use separator as the field separator. This is equivalent to \pset fieldsep or \f. I would guess -F "," would do the trick. On

[ADMIN] dumping query results to a csv

2005-08-25 Thread David Durham
This is kind of a pg-admin newbie question, so apologies in advance. Anyway, I'd like to issue a command that dumps the results of a query to a txt file in comma delimited format. Does PostgreSQL ship with something to do this? I searched the web, but found what appeared to be non-free solution