[gdal-dev] ogr2ogr question

matteo matteo.ghetta at gmail.com
Mon Dec 21 07:29:51 PST 2020


Hi all,

I'm really stuck on a ogr2ogr command.

I've a template.gpkg file with some tables and what I'm trying to do is 
to overwrite some of these tables with some already existing views of a 
PG database.

The tables and views have the same structure and geometry, basically I'm 
trying to create a my_data.gpkg with the same tables of the 
template.gpkg file, but overwriting some of these tables with the PG 
view contents.

This is the ogr2ogr command I'm using, but nothing is happening (the 
data.gpkg remains the same of template.gpkg).

ogr2ogr -f GPKG /home/matteo/Desktop/data.gpkg "PG:dbname='mydb' 
host=myhost port=5432 user='myuser' password='xxxxx' sslmode=disable" 
--config PG_USE_COPY YES -sql "SELECT * FROM "_003"."intap" " -overwrite 
-progress

(the intap table should be overwritten with the content filtered by the 
-sql statement: "_003"."intap" is the view of PG).

I search everywhere for a parameter that could solve this problem but I 
didn't find any

Thanks for any help

Cheers

Matteo


More information about the gdal-dev mailing list