[gdal-dev] ogr2ogr changes field length

Even Rouault even.rouault at spatialys.com
Thu Oct 7 08:59:05 PDT 2021


If you add -lco RESIZE=YES fields will be resized to their minimum size. 
See https://gdal.org/drivers/vector/shapefile.html#layer-creation-options

Le 07/10/2021 à 17:40, matteo a écrit :
> Even,
>
> still a weird issue with the command. I'm using this command
>
> ogr2ogr -f "ESRI Shapefile" /home/matteo/myfolder "PG:dbname='mydb' 
> host=myhost port=5432 user='myuser' password='mypws' sslmode=disable 
> schemas='dati'" --config PG_USE_COPY YES --config PG_LIST_ALL_TABLES 
> YES -progress'
>
> so without any append or overwrite (dumping a whole schema in a folder).
>
> I've both spatial and not spatial tables and for all of them the text 
> fields are created in PG like:
>
> CREATE TABLE mytable (
>     ID SERIAL PRIMARY KEY,
>     .....
>     NOTE text
> )
>
> and all these fields are 80 characters long in the newly created 
> shapefiles...
>
> I don't know if I can give some more information..
>
> Cheers and thanks
>
> Matteo

-- 
http://www.spatialys.com
My software is free, but my time generally not.



More information about the gdal-dev mailing list