[GIS] importing shapefile in postgres

pgadmin-3postgispostgresql

I am trying to import a shapefile to my database in postgres but there is no shapefile loader appearing in the plugin menu in PgAdmin.

enter image description here

Postgis is definitely installed as I have added it as an extension to my database

The postgis extension has already been created. But I continue to get a syntax error:

postgres=# CREATE EXTENSION postgis;
ERROR:  extension "postgis" already exists
postgres=# 
postgres=# shp2pgsql -I -s 4326 /Users/alexander/Downloads/pluto/pluto.shp pluto | psql -U postgres -d postgres;
ERROR:  syntax error at or near "shp2pgsql"
LINE 1: shp2pgsql -I -s 4326 /Users/alexander/Downloads/pluto/pluto....
        ^
postgres=# 

Any idea as to what the problem could be?

Best Answer

To load shapefile to postgres database

  1. Go to start menu
  2. Search "POSTGIS 2.0 Shapefile and DBF Loader Exporter" and load your shapefile through it.

OR

  1. You can load your shapefile to QGIS.
  2. Connect to your database from within QGIS.

  3. Then use Database manager to import your shapefile to your desired postgres database.