I’ve installed posgres on a ubuntu droplet. I have some files the I cloned to the root users account under the directory of mapnik/data. The exact file I am interested in is
/root/mapnik/data/world_merc.shp
When I log in as postgres and try to import this file from the root I get an error of “unable to open”. The exact command I am using to import is shp2pgsql -s 4326 -a /root/mapnik/data/world_merc.shp | psql -h localhost -d postgres -U
I am guessing this is because postgres cannot read from the root user’s files? Any help to get this resolved
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there,
What are the file permissions on the file you are trying to import?
You can find out the file permissions by typing:
ls -al /root/mapnik/data/world_merc.shp
If the owner and the group are root, you may need to change ownership of the file to the postgres user to access it.
You can change the ownership of the file by typing:
sudo chown postgres:postgres /root/mapnik/data/world_merc.shp
That should allow you to import it into the psql command.
Cheers
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.