Re: [gdal-dev] ogr2ogr postgis to sqlite composite primary key issueissue

2023-08-15 Thread Rahkonen Jukka
Hi, Could you share some test data? A "CREATE TABLE..." SQL and an INSERT for one row should be enough. Use minimal number or fields for keeping it simple. -Jukka Rahkonen- Lähettäjä: gdal-dev Puolesta Brent Wood via gdal-dev Lähetetty: keskiviikko 16. elokuuta 2023 4.27 Vastaanottaja: gdal-d

Re: [gdal-dev] ogr2ogr postgis to sqlite composite primary key issueissue

2023-08-15 Thread Scott
Change target.gpkg to target.sqlite ...and in the -sql use something like "select cast(primary_key as integer) as key, [all your other columns] from table" Thanks, The primary key on the source tables is on required columns - it is a natural key based on core data so cannot be excluded to

Re: [gdal-dev] ogr2ogr postgis to sqlite composite primary key issueissue

2023-08-15 Thread Brent Wood via gdal-dev
Thanks, The primary key on the source tables is on required columns - it is a natural key based on core data so cannot be excluded to have a meaningful dataset exported. Also, invoking it your way provides a data only export - just the output of a select statement. I'm trying to create repli

Re: [gdal-dev] ogr2ogr postgis to sqlite composite primary key issueissue

2023-08-15 Thread Scott
You could build your column list without that specific column and pass it to ogr2ogr (bash): ogr2ogr -sql "select $(psql -d mydb --pset='footer=off' -F',' -qAc "select * from table where false" |sed 's/columnToOmit,//g') from table" target.gpkg PG:dbname=mydb On 8/15/23 17:12, Brent Wood vi

[gdal-dev] ogr2ogr postgis to sqlite composite primary key issueissue

2023-08-15 Thread Brent Wood via gdal-dev
Hi, I'm looking to use ogr2ogr to replicate a Postgis schema into a Spatialite database. (Make a snapshot copy of institutional tables on a field laptop with possible no internet access) I have a script to identify the relevant tables and invoke ogr2ogr to copy each table. Some of the source (P