我的问题与此类似one https://stackoverflow.com/q/14083311/1777654但在 Linux Mint 15 (Ubuntu) 中。我已经尝试过标准COPY http://www.postgresql.org/docs/9.1/static/sql-copy.html(我一直在 Windows 上使用):
COPY public.bio FROM 'tmp/sisinst_bio.csv'
DELIMITERS '|' CSV;
我收到此错误:
ERROR: could not open file "/tmp/sisinst_bio.csv" for reading: Permission denied
数据库的所有者和用户是postgres
.
Tries
(1) 创建一个与我的 Ubuntu 用户帐户相同的用户(zach
)并更改数据库的所有者。
(2) 将csv移动到Ubuntu的各个部分
sudo cp -r /home/zach/Documents/Postgres91/sisinst_postgresql_bio_test.csv /usr/share/postgresql/9.1
sudo cp -r /home/zach/Documents/Postgres91/sisinst_postgresql_bio_test.csv /tmp
这真的很容易,但我被困住了。我不确定这是否是Postgresql
or Ubuntu
问题。
Update
这有什么关系吗this http://www.postgresql.org/message-id/c939097c0604181058r790128c6ge87654af630ce9a5@mail.gmail.com?
一如既往,谢谢大家
For the Permissions
in the CSV
(Right Click
-> Properties
-> Permissions
), the Others
被设置为None
.
为了解决这个问题,以便Postgres
用户可以使用它,我改变了Others
to Read-only
这有效。
最终,可能会更好Postgres
用户在一个Group
但目前这超出了我的范围。
我愿意接受更好的答案。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)