I am trying to import features from a geopackage (or a shapefile) in an existing table of a distant PostgreSQL database. I use ogr2ogr which I run from OSGeo4W Shell.
The code used with the geopackage is:
ogr2ogr -update -append -progress -f PostgreSQL -nln schema.my_table PG:"dbname=my_database host=my_server user=me password=my_password port=5433" D:\temp\SIG\my_geopackage.gpkg
The code used with the shapefile (an export from the gpkg) is:
ogr2ogr -update -append -progress -f PostgreSQL -sql "SELECT [variables as var] from my_shapefile" -nln schema.my_table PG:"dbname=my_database host=my_server user=me password=my_password port=5433" D:\temp\SIG\my_shapefile.shp
(in this case I must call a select to rename the variables as their name is truncated by the conversion in shp)
In both case, I get a "done" message and I can find the data is my_table BUT their are not spatial anymore... I mean I can't see the polygons corresponding to each line.
What do I do wrong?