Eric Guo's blog.cloud-mes.com

Hoping writing JS, Ruby & Rails and Go article, but fallback to DevOps note

Export the CSV Directly in Postgresql Psql

Permalink

Export the data from SQL

psql -d postgres
\copy (SELECT vote_options.title, vote_options.vote_index, vote_options.user_votes_count, (DENSE_RANK() OVER(ORDER BY user_votes_count DESC ) ) as rank FROM "vote_options" WHERE "vote_options"."vote_id" = 1 ORDER BY "rank") to 'vote_rank.csv' with csv

Comments