I am trying to update a PostgreSQL database with a CSV file that I am downloading to the server. I have tried for many hours and it works perfectly locally but cannot get it to work on the server. Here is my command:
path = "/data/reporting/releases/20150202181737/data/storyboards.csv"
sql = "COPY storyboards (id, name, category, service_line, account_id, account_name, account_salesforce_id, banner_image) FROM \'#{path}\' DELIMITER ',' CSV;"
ActiveRecord::Base.connection.execute(sql)
Here is the error message:
COPY storyboards (id, name, category, service_line, account_id, account_name, account_salesforce_id, banner_image) FROM '/data/reporting/releases/20150202181737/data/storyboards.csv' DELIMITER ',' CSV;
PG::InsufficientPrivilege: ERROR: must be superuser to COPY to or from a file
HINT: Anyone can COPY to stdout or from stdin. psql's \copy command also works for anyone.
: COPY storyboards (id, name, category, service_line, account_id, account_name, account_salesforce_id, banner_image) FROM '/data/reporting/releases/20150202181737/data/storyboards.csv' DELIMITER ',' CSV;
ActiveRecord::StatementInvalid: PG::InsufficientPrivilege: ERROR: must be superuser to COPY to or from a file
HINT: Anyone can COPY to stdout or from stdin. psql's \copy command also works for anyone.
: COPY storyboards (id, name, category, service_line, account_id, account_name, account_salesforce_id, banner_image) FROM '/data/reporting/releases/20150202181737/data/storyboards.csv' DELIMITER ',' CSV;
Can you recommend a solution for this issue as I'm sure I am not the only one who has tried to do this. I am hosting my app on Engineyard. Is this an Engineyard configuation issue?