Re: dumping query results to a csv

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Adi Alurkar
adi@xxxxxx


On Aug 25, 2005, at 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 searched the web, but found what appeared to be
non-free solutions.

Thanks,

Dave


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux