【发布时间】:2015-02-03 07:07:27
【问题描述】:
我正在尝试使用下载到服务器的 CSV 文件更新 PostgreSQL 数据库。我已经尝试了很多小时,它在本地完美运行,但无法让它在服务器上运行。这是我的命令:
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)
这是错误信息:
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;
您能否推荐一个解决此问题的方法,因为我确信我不是唯一一个尝试这样做的人。我在 Engineyard 上托管我的应用程序。这是 Engineyard 配置问题吗?
【问题讨论】:
标签: ruby database postgresql csv engineyard