Re: [gdal-dev] GPKG to PG single transaction, different schemas

2024-05-15 Thread Matteo Ghetta via gdal-dev
Hi Even, thanks for the reply! I downloaded the https://github.com/OSGeo/gdal/blob/master/swig/python/gdal-utils/osgeo_utils/samples/ogr2vrt.py file and used like: python3 ogr2vrt.py export_db.gpkg export_db.vrt first_layer second_layer but I get the following error: Traceback (most recent

[gdal-dev] GPKG to PG single transaction, different schemas

2024-05-14 Thread Matteo Ghetta via gdal-dev
Hi all, I've a geopackage with many layers (in the following example let's pretend just 2) that I want to import in a single transaction (important!) into a PG database. GPKG and PG table names are the same, but it can happen that the tables are in different schemas. I couldn't find the corr

Re: [gdal-dev] Export PG to GPKG with foreign keys

2024-04-21 Thread Matteo Ghetta via gdal-dev
Hi Even, thanks for the reply! I had this feeling, but now I'm sure Cheers and thanks Matteo On 4/19/24 11:32, Even Rouault wrote: Le 19/04/2024 à 10:25, Matteo Ghetta via gdal-dev a écrit : Hi all, I'm trying to export a PG table with several foreign keys to a geopackage. Wh

[gdal-dev] Export PG to GPKG with foreign keys

2024-04-19 Thread Matteo Ghetta via gdal-dev
Hi all, I'm trying to export a PG table with several foreign keys to a geopackage. What I tried so far are the native QGIS export and the QGIS Processing algorithm "Package layer" with the "Export related layers following..." option activated. I'm checking ogr2ogr but I cannot see any option

Re: [gdal-dev] COPY statement failed with PG_USE_COPY=YES

2023-11-27 Thread Matteo Ghetta via gdal-dev
of `pg:dbname=autotest'    using driver `PostgreSQL' successful. Layer name: date_null Geometry: None Feature Count: 1 Layer SRS WKT: (unknown) FID Column = ogc_fid id: Integer (9.0) dt: Date OGRFeature(date_null):1    id (Integer) = 1    dt (Date) = (null) Even Le 21/11/2023 à 09

Re: [gdal-dev] COPY statement failed with PG_USE_COPY=YES

2023-11-27 Thread Matteo Ghetta via gdal-dev
id: Integer (9.0) dt: Date OGRFeature(date_null):1   id (Integer) = 1   dt (Date) = (null) Even Le 21/11/2023 à 09:24, Matteo Ghetta via gdal-dev a écrit : Hi all, I'm trying to import (many) shapefiles into a PG database. I'm facing the following error, but only when PG_USE_COPY is set

[gdal-dev] COPY statement failed with PG_USE_COPY=YES

2023-11-21 Thread Matteo Ghetta via gdal-dev
Hi all, I'm trying to import (many) shapefiles into a PG database. I'm facing the following error, but only when PG_USE_COPY is set to YES: ERROR 1: COPY statement failed. ERROR: date/time field value out of range: "/00/00" CONTEXT: COPY TABLE, line 12682, column DATA_INI: "/00/00"