Skip to main content
2 of 2
corrected spelling
nmtoken
  • 13.6k
  • 5
  • 38
  • 89

Use ogr2ogr to delete content of table and load new data from shapefile

Is it possible to load a shapefile to a PostGIS database by replacing the content of the table with the new content of the shapefile WITHOUT DROPPING the table?

I want to do this using ogr2ogr.

In the past I have used shp2pgsql, which gives you the option of four flags (-drop|-append|-create|-prepare) but none of these options actually maintains the table and deletes the data.

Is there something like this in ogr2ogr?

user1919
  • 2.7k
  • 2
  • 32
  • 75