Reputation: 659
I know where shp2pgsql
is in the postgresql directory but I'm not sure what commands to use after that. I've read the manual thoroughly, and I am aware of all the arguments and options for the shp2pgsql
command. I get the error:
-bash: shp2pgsql: command not found
Is it a permissions problem perhaps?
Upvotes: 5
Views: 15871
Reputation: 659
Solution is to export the path of the program and put it into $PATH variable.
Another option is to move the command into directories already contained in PATH such as /usr/bin.
Example
export PATH=/Library/Postgresql/9.0/bin/:$PATH
or
Upvotes: 1
Reputation: 227
The right command is «shp2pgsql», you have got a typo.
Usage example :
# shp2pgsql -c -D -s 4269 -I shaperoads.shp myschema.roadstable > roads.sql
# psql -d roadsdb -f roads.sql
You first generate a sql file, which you then load into your database.
Upvotes: 13