[gdal-dev] RuntimeError no COPY in progress

Even Rouault even.rouault at spatialys.com
Thu Oct 2 12:35:47 PDT 2014


Le jeudi 02 octobre 2014 21:32:14, Ari Jolma a écrit :
> 2014-10-02 19:23:03 EEST ERROR: COPY from stdin failed: COPY terminated
> by new PQexec
> 
> > Hum, definitely weird. I've an idea to debug that. If you use GDAL trunk,
> > you could enable the OGR C API spy mechanism, as the Perl bindings used
> > the C API. That will produce a OGR Python script (sorry for Python ;-))
> > that should have the same side effects regarding the OGR PostgreSQL
> > driver as your original Perl script.
> > 
> > See http://www.gdal.org/ograpispy_8h.html
> 
> ok, I'll try that (recompile takes time) but an intermediate information
> is that the situation occurs only when the same datasource is used for
> reading and writing. I'm converting Polygons into LineStrings, so I'm
> reading from the database the polygons from one table and writing back
> lines into a different table. Now when I had two datasource objects to
> the same database the problem did not occur again.

Don't search more. Yes, this is a feature/defect of the PG driver currently. 
It has issues with transactions that make using it at the same time as a 
reader and a writer with the same OGR datasource will not work properly. The 
work around is to instanciate 2 datasource objects indeed.

> 
> Ari

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list