[Qgis-user] edit PostGIS-Layer in QGIS 2.0.1

Stefan Keller sfkeller at gmail.com
Mon Feb 24 17:36:07 PST 2014


Hallo Sylvia

What about writing two rules with one update statement in each?
I'm rather used to Postgres 9: So there you would do that with INSTEAD OF
TRIGGERs.

--S.


Am 24. Februar 2014 09:31 schrieb Sylvia Preuß <sylvia.preuss at obk.de>:

> Hello everybody,
>
>
>
> I want to write into PostGIS database from a view in QGIS 2.0.1
>
> I added in QGIS a PostGIS-layer, not from a table but from a view.
>
> This view shows datas from 2 tables. I can insert a new object in QGIS and
> commit. But if I want to change the object in QGIS (UPDATE in PostGIS) I
> can update one table only. I can change the order of  the update-
> statements in the rule and put the second one on the first place and always
> the first update- statements is successful. No matter how many
> INSERT-statements I put into the rule - all are successful. Why is it
> working to run more than one INSERT-statement and not more than one
> UPDATE-statement?
>
>
>
> CREATE OR REPLACE RULE onupdate_qry_myview AS
>
>     ON UPDATE TO myschema.qry_ myview DO INSTEAD (
>
> INSERT INTO myschema.temptable (attributeyyy)
>
>   VALUES (11);
>
> INSERT INTO myschema.temptable (attributexxx)
>
>   VALUES (15);
>
> UPDATE myschema.table1 SET attributezzz = 10
>
>   WHERE table1.oid = 100;
>
> UPDATE myschema.table2 SET attributezzz = 10
>
>   WHERE table2.oid = 100;
>
> );
>
>
>
> PostgreSQL 8.1.4 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.1.0
> (SUSE Linux)
>
> PostGIS 1.3
>
> QGIS 2.0.1 on Windows7
>
> Can somebody help?
> Sylvia
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20140225/3f053c50/attachment.html>


More information about the Qgis-user mailing list