pramsey / pgsql-ogr-fdw

PostgreSQL foreign data wrapper for OGR
MIT License
237 stars 34 forks source link

GeoPackage database locked for writing #212

Closed bmcbride closed 3 years ago

bmcbride commented 3 years ago

I'm having trouble writing to an FDW table based on a GeoPackage file. It seems as if Postgres obtains a permanent lock on the SQLite database. SELECTs work fine, but I'm getting the below error when trying to UPDATE.

ERROR:  GDAL AppDefined [1] failed to execute update : database is locked
SQL state: XX000

Has anyone else experienced this and are there any workarounds? Thanks!

bmcbride commented 3 years ago

Setting the GeoPackage SQLite Journal Mode to WAL seems to resolve the database locking issue I was experiencing.