How do you export a Postgres database to CSV when you do NOT have superuser 
privileges?

The line of code in question (for my Bargain Stock Funds project at 
https://github.com/jhsu802701/bsf-scrape/blob/master/scrape.rb) is:

      @conn.exec("COPY funds TO '" + csv_path + "' With CSV HEADER;")

I need superuser access in order to run this code.  This is OK in the 
development environment, because I used my root privileges (through sudo) 
to give my username superuser status for Postgres.

However, this does not work in the production environment. where so my 
username doesn't have superuser status.

Is there another way to create a CSV file from a Postgres database?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/eT-wyynLbSgJ.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to