我刚刚关注本教程 HERE ,关于,pgrouting,当我运行followng命令时:
psql -U user -d postgres -f ~/Desktop/pgrouting-workshop/data/sampledata_routing.sql
我收到错误提及以下内容:
/var/lib/postgresql/Desktop/pgrouting-workshop/data/sampledata_routing.sql: No such file or directory
在我的桌面上,我确实有一个文件夹pgrouting-workshop
,它包含文件夹data
和sql
转储文件。
那我为什么会收到此错误?
答案 0 :(得分:1)
因为Desktop
用户的主目录中的postgres
不在/var/lib/postgresql
,而是位于/home/myusername/Desktop
?
据推测,您运行的psql
命令位于sudo -u postgres -i
shell下,因此~/
表示postgres
用户的主目录。
使用~myusername/Desktop/blahblah
。请注意,postgres
用户可能无权访问它;您可以chmod go+x ~ ~/Desktop
(以您的用户身份运行,而不是postgres
)进行更改。