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

2023-08-15 Thread Rahkonen Jukka
taja: gdal-dev@lists.osgeo.org; Scott Aihe: Re: [gdal-dev] ogr2ogr postgis to sqlite composite primary key issueissue 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, i

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