The quickest way from Postgres to a spreadsheet
Need to quickly get some data out of Postgres and into Excel/Numbers/Google Docs/etc?
copy (select foo, bar from baz) to stdout with csv;
From within any psql prompt (including the heroku one) and then you can just copy/paste into your spreadsheet program of choice.
For google docs I've found it works better to paste it into a CSV file and then upload it rather than dicking around with copy and paste.
Written by John Barton
Related protips
1 Response
Nice tips. I'm on OS-X and getting data into numbers or google docs wasn't super smooth me when copy-pasting. I had to save the .csv file to disk, and open that in numbers or google docs. Copy/paste didn't split columns on the commas.
TY for the helpful post. I learned some new postgres syntax from this.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Heroku
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#