1

I am using RubyMine 6.3.3 Database Console window to run queries and export them to CSV

This involves 3 steps

Step 1. Run the query, wait quite some time to get results in a Visual way

Run the query to get results in a Visual way

Step 2. Click on the "File Icon" and select "Save All To File"

Click on the "File Icon" and select "Save All To File

Step 3: Wait again the same time of the step 1 to export it to CSV

enter image description here

I have checked RubyMine forums, the settings, whithout any success.

I also found this question on how to save (postgres) sql output to csv file

The answer to that question mentions this command

Copy (Select * From foo) To '/tmp/test.csv' With CSV;

but by using that approach the file is save on the server which I dont have direct access to.

Is there a way to run the query and get the results directly into a local CSV file, without getting the visual results

Community
  • 1
  • 1
Mauricio Gracia Gutierrez
  • 10,288
  • 6
  • 68
  • 99

4 Answers4

3

Yes, there is a way to do what you ask: enter image description here

moscas
  • 9,064
  • 36
  • 42
1

This feature is working in RubyMine 8

On the right side of your query result you can select the export type.

enter image description here

Refresh/reload your query

enter image description here

Select the lines you want to export, e.g. cmd + a to select all

copy the values with cmd + c

open a new textfile and paste the data with cmd + v

lumos0815
  • 3,908
  • 2
  • 25
  • 25
  • Or, if you want to export the whole table/result at once, there is a button "Dump data to file" – moscas Mar 15 '19 at 11:27
0

This feature is not yet implemented and is already and feature that has been requested to JetBrains and is reported in this links

http://youtrack.jetbrains.com/issue/DBE-454

http://track.jetbrains.com/issue/DBE-442#tab=Linked Issues

So people interested in tracking this and update this answer please do.

Mauricio Gracia Gutierrez
  • 10,288
  • 6
  • 68
  • 99
0

If you can connect with psql use the \copy command to save the file at the client.

http://www.postgresql.org/docs/current/static/app-psql.html

Clodoaldo Neto
  • 118,695
  • 26
  • 233
  • 260