[Qgis-developer] Post-processing queries on postgis layers (after insert/delete/update)
Olivier Dalang
olivier.dalang at gmail.com
Wed Mar 18 17:09:40 PDT 2015
Jürgen,
I've been able to solve my problem by adding a default value on my view
(and by also forwarding the ID in the insert trigger) :
> ALTER VIEW test_view ALTER COLUMN id SET DEFAULT nextval('test_id_seq');
I updated the gist just in case :
https://gist.github.com/olivierdalang/cad70df2d463d0b87566
Thank you very much for your help :)
Olivier
On Mar 18, 2015 7:17 PM, "Jürgen E." <jef at norbit.de> wrote:
> Hi Olivier,
>
> On Wed, 18. Mar 2015 at 18:40:20 +0100, Olivier Dalang wrote:
> > Am I doing something wrong ?
>
> Not really - just something that isn't expected.
>
> > Or is QGIS using some other way to get back the ID of a new feature ? Any
> > idea of what that could be ?
>
> It retrieves the default values for all attributes (which might be a call
> to
> nextval), executes them and uses the result for the insert. So it knows
> the id before the insert and can update the feature with it.
>
>
> Jürgen
>
> --
> Jürgen E. Fischer norBIT GmbH Tel.
> +49-4931-918175-31
> Dipl.-Inf. (FH) Rheinstraße 13 Fax.
> +49-4931-918175-50
> Software Engineer D-26506 Norden
> http://www.norbit.de
> QGIS release manager (PSC) Germany IRC: jef on FreeNode
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150319/08a6cc62/attachment.html>
More information about the Qgis-developer
mailing list