I am trying to export a table from postgres to a geopackage. But I get the following errors with the following command.

ogr2ogr -f GPKG /opt/data/ways.gpkg "PG:host=postgres dbname=osm user=postgres port=5432 " -sql "select * from ways"
ERROR 1: COMMIT transaction failed: disk I/O error
ERROR 1: Terminating translation prematurely after failed translation from sql statement.
ERROR 1: Transaction not established
ERROR 1: COMMIT transaction failed: disk I/O error

If I do the same thing but export to shapefile I dont have any issues. It will successfully export. Also it may be worth noting that Postgres is running in a docker container and I am trying to run this command in a seperate container. If I run the same command to export to gpkg from my macbook it works fine.

I am wondering if it is a sqlite issue but cant find anything there that has helped either.

  • What is GDAL version? What is you operation system version? How do you install gdal? – Dmitry Baryshnikov Jan 29 '18 at 8:33
  • GDAL 2.1.2 on ubuntu with RUN apt-get install -y libgdal-dev inside docker. With more experimentation I found that it will work once in any given folder. If I later delete the geopackage and try to run it again it fails. So I am now exporting to a temp folder and then copying it over to the final destination. – James Jan 31 '18 at 15:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.