0

I was just following this tutorial HERE, its about, pgrouting, When I run the following command:

psql -U user -d postgres -f ~/Desktop/pgrouting-workshop/data/sampledata_routing.sql

I get an error saying the following:

/var/lib/postgresql/Desktop/pgrouting-workshop/data/sampledata_routing.sql: No such file or directory

On my desktop I do have a folder pgrouting-workshop, which does contain the folder data and the sql dump file.

So why am I getting this error?

halfer
  • 19,824
  • 17
  • 99
  • 186
Alexander Solonik
  • 9,838
  • 18
  • 76
  • 174

1 Answers1

1

Because your Desktop isn't in the postgres user's home directory, located at /var/lib/postgresql, but is instead located at /home/myusername/Desktop?

Presumably the psql command you're running is under a sudo -u postgres -i shell, so ~/ means the postgres user's home directory.

Use ~myusername/Desktop/blahblah. Note that the postgres user may not have permission to access it; you can chmod go+x ~ ~/Desktop (run as your user, not postgres) to change that.

Craig Ringer
  • 307,061
  • 76
  • 688
  • 778