[QGIS-Developer] Postgis loading using COPY instead of INSERTS?

Régis Haubourg regis.haubourg at gmail.com
Thu Jun 15 02:10:49 PDT 2017

Hi Nyall,
That's great!

from a user point of view, the first two main use cases that would benefit
of implementing that would be the DB Manager drag and drop loader and the
processing postgis loader algorithm.

2017-06-15 6:00 GMT+02:00 Nyall Dawson <nyall.dawson at gmail.com>:

> On 11 June 2017 at 08:04, Nyall Dawson <nyall.dawson at gmail.com> wrote:
> > On 11 June 2017 at 05:49, Matthias Kuhn <matthias at opengis.ch> wrote:
> >
> >>
> >> Something else to discuss is what will be sent along with the
> >> `featureAdded(QgsFeatureId fid)` signal if the id is generated on the
> DB but
> >> not propagated back to the client.
> >>
> >
> > I don't think this is a big limitation - we just note it in the docs
> > for the fast insert flag that featureAdded won't be emitted. It's only
> > emitted when adding to a vector layer anyway, and most of the cases
> > where the fast insert flag will be used will be adding directly to a
> > data provider.
> Right, I've implemented the flag over in https://github.com/qgis/QGIS/
> pull/4734
> This opens the possibility of using a COPY statement in the postgres
> provider when FastInsert flag is set. I haven't done that, so
> presuming the PR is acceptable it'd be a good time for someone else to
> jump in and make this improvement. All required changes would be self
> contained in QgsPostgresProvider::addFeatures.
> This would be great to have for 3.0 - we've already made huge
> improvements in the speed of various related operations, and
> implementing COPY for FastInsert would then also have massive flow on
> benefits to processing algs which are saving their results direct to a
> postgres database.
> Nyall
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20170615/3e6e92f1/attachment.html>

More information about the QGIS-Developer mailing list