Why do I get error import shapefile in PostGIS?

Why do I get error import shapefile in PostGIS?

ERROR 1: Terminating translation prematurely after failed translation of layer world_boundaries (use -skipfailures to skip errors) I also tried to import it through the GUI shp2pgsql and I get the following error:

How to connect PostgreSQL to the PostGIS database?

Just go to the toolbox (Advanced Interface) and search for Import into Postgis. The dialog is quite straightforward (The connection to the database needs to be done beforehand)

How to import a shapefile to PostGIS with ogr2ogr?

As you discovered by trial and error, there were few nagging issues you needed to fix, the last of which was resolved using ogr2ogr’s -nlt GEOMETRY * argument.

How to import geometries from PostGIS into QGIS?

Depending on your needs, a nice way to import geometries to PostGIS is using the Import into PostGIS tool from QGIS. Just go to the toolbox (Advanced Interface) and search for Import into Postgis. The dialog is quite straightforward (The connection to the database needs to be done beforehand)

How to test PostGIS import with shp2pgsql?

I would have been stumped by your second error for awhile, but by testing your SQL user with a different import utility (shp2pgsql), which was smart, you got a more precise error message and gave your SQL user necessary privileges on the spatial_ref_sys table.

How to import spatial data into PostGIS database?

The most common data format for spatial data has traditionally been the ESRI shapefile. shp2pgsql is a command line tool to import ESRI shapefiles to the database. Under Unix, you can use the following command for importing a new PostGIS table:

Can a shapefile be opened in another software?

As @user1919 discovered, make sure your OS user has sufficient privileges to access the shapefile! As they demonstrated, it can help to try opening the shapefile in another software, like QGIS—if it works in one software, then it’s not corrupt, and it should work in other software.